Skip to content

Commit 1256ff1

Browse files
committed
add reordering test
1 parent ad15039 commit 1256ff1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: mlir-opt %s --normalize --mlir-use-nameloc-as-prefix 2>&1 | FileCheck %s
2+
3+
// CHECK-LABEL: func.func @bar(
4+
// CHECK-SAME: %[[ARG0:.*]]: i32) -> i32 {
5+
// CHECK: %[[VAL_0:.*]] = arith.constant 2 : i32
6+
// CHECK: %vl15831$51356--arg0$ = arith.addi %[[ARG0]], %[[VAL_0:.*]] : i32
7+
// CHECK: %vl14084$187c2$ = arith.constant 6 : i32
8+
// CHECK: %op27844$vl14084-vl15831$ = arith.addi %vl14084$187c2$, %vl15831$51356--arg0$ : i32
9+
// CHECK: %vl14084$4c6ac$ = arith.constant 8 : i32
10+
// CHECK: %op27844$op27844-vl14084$ = arith.addi %op27844$vl14084-vl15831$, %vl14084$4c6ac$ : i32
11+
// CHECK: return %op27844$op27844-vl14084$ : i32
12+
// CHECK: }
13+
func.func @bar(%a0: i32) -> i32 {
14+
%c2 = arith.constant 2 : i32
15+
%c6 = arith.constant 6 : i32
16+
%c8 = arith.constant 8 : i32
17+
%a = arith.addi %a0, %c2 : i32
18+
%b = arith.addi %a, %c6 : i32
19+
%c = arith.addi %b, %c8 : i32
20+
func.return %c : i32
21+
}

0 commit comments

Comments
 (0)