aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/Transforms/test-operation-folder-commutative.mlir
blob: 8ffdeb54f399dcfb24fb7e10f22e89e45da1f421 (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: mlir-opt --pass-pipeline="builtin.module(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
}