File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments