xref: /llvm-project/mlir/test/Examples/transform-opt/pass.mlir (revision 619ee20b3911f9a481a75a64704c80aef16af9d0)
1// RUN: mlir-transform-opt %s | FileCheck %s
2
3module attributes {transform.with_named_sequence} {
4  // CHECK-LABEL: @return_42
5  // CHECK: %[[C42:.+]] = arith.constant 42
6  // CHECK: return %[[C42]]
7  func.func @return_42() -> i32 {
8    %0 = arith.constant 21 : i32
9    %1 = arith.constant 2 : i32
10    %2 = arith.muli %0, %1 : i32
11    return %2 : i32
12  }
13
14  transform.named_sequence @__transform_main(%arg0: !transform.any_op) {
15    %arg1 = transform.apply_registered_pass "canonicalize" to %arg0 : (!transform.any_op) -> !transform.any_op
16    transform.print %arg1 : !transform.any_op
17    transform.yield
18  }
19}
20