Files
clang-p2996/mlir/test/Transforms/test-operation-folder-commutative.mlir
rkayaith 13bd410962 [mlir][Pass] Include anchor op in -pass-pipeline
In D134622 the printed form of a pass manager is changed to include the
name of the op that the pass manager is anchored on. This updates the
`-pass-pipeline` argument format to include the anchor op as well, so
that the printed form of a pipeline can be directly passed to
`-pass-pipeline`. In most cases this requires updating
`-pass-pipeline='pipeline'` to
`-pass-pipeline='builtin.module(pipeline)'`.

This also fixes an outdated assert that prevented running a
`PassManager` anchored on `'any'`.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D134900
2022-11-03 11:36:12 -04:00

12 lines
467 B
MLIR

// RUN: mlir-opt --pass-pipeline="builtin.module(func.func(test-patterns))" %s | FileCheck %s
// CHECK-LABEL: func @test_reorder_constants_and_match
func.func @test_reorder_constants_and_match(%arg0 : i32) -> (i32) {
// CHECK: %[[CST:.+]] = arith.constant 43
%cst = arith.constant 43 : i32
// CHECK: return %[[CST]]
%y = "test.op_commutative2"(%cst, %arg0) : (i32, i32) -> i32
%x = "test.op_commutative2"(%y, %arg0) : (i32, i32) -> i32
return %x : i32
}