xref: /llvm-project/mlir/test/Transforms/test-operation-folder-commutative.mlir (revision 0f8a6b7d03550cb58cf49535af2de2230abfe997)
1// RUN: mlir-opt --pass-pipeline="builtin.module(test-greedy-patterns)" %s | FileCheck %s
2
3// CHECK-LABEL: func @test_reorder_constants_and_match
4func.func @test_reorder_constants_and_match(%arg0 : i32) -> (i32) {
5  // CHECK: %[[CST:.+]] = arith.constant 43
6  %cst = arith.constant 43 : i32
7  // CHECK: return %[[CST]]
8  %y = "test.op_commutative2"(%cst, %arg0) : (i32, i32) -> i32
9  %x = "test.op_commutative2"(%y, %arg0) : (i32, i32) -> i32
10  return %x : i32
11}
12