Skip to content

Commit 0e90f39

Browse files
author
Jerry Wu
committed
Add missing mlir file
1 parent 9c20950 commit 0e90f39

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 -test-loop-zero-trip-check -split-input-file | FileCheck %s
2+
3+
func.func @no_replace_scf_while_with_zero_trip_check(%bound : i32) -> i32 {
4+
%cst0 = arith.constant 0 : i32
5+
%cst5 = arith.constant 5 : i32
6+
%res:2 = scf.while (%iter = %cst0) : (i32) -> (i32, i32) {
7+
%cond = arith.cmpi slt, %iter, %bound : i32
8+
%inv = arith.addi %bound, %cst5 : i32
9+
scf.condition(%cond) %iter, %inv : i32, i32
10+
} do {
11+
^bb0(%arg1: i32, %arg2: i32):
12+
%next = arith.addi %arg1, %arg2 : i32
13+
scf.yield %next : i32
14+
}
15+
return %res#0 : i32
16+
}
17+
18+
// TODO(pzread): Update the test once the replaceZeroTripCheck is implemented.
19+
// CHECK-LABEL: func.func @no_replace_scf_while_with_zero_trip_check
20+
// CHECK-NOT: scf.if
21+
// CHECK: scf.while

0 commit comments

Comments
 (0)