@@ -88,18 +88,15 @@ func.func @unnormalized_loops() {
88
88
89
89
// Number of iterations in the outer scf.
90
90
// CHECK: %[[diff_i:.*]] = arith.subi %[[orig_ub_i]], %[[orig_lb_i]]
91
- // CHECK: %[[c1:.*]] = arith.constant 1
92
- // CHECK: %[[step_minus_c1:.*]] = arith.subi %[[orig_step_i]], %[[c1]]
93
- // CHECK: %[[dividend:.*]] = arith.addi %[[diff_i]], %[[step_minus_c1]]
94
- // CHECK: %[[numiter_i:.*]] = arith.divui %[[dividend]], %[[orig_step_i]]
91
+ // CHECK: %[[numiter_i:.*]] = arith.ceildivsi %[[diff_i]], %[[orig_step_i]]
95
92
96
93
// Normalized lower bound and step for the outer scf.
97
94
// CHECK: %[[lb_i:.*]] = arith.constant 0
98
95
// CHECK: %[[step_i:.*]] = arith.constant 1
99
96
100
97
// Number of iterations in the inner loop, the pattern is the same as above,
101
98
// only capture the final result.
102
- // CHECK: %[[numiter_j:.*]] = arith.divui {{.*}}, %[[orig_step_j]]
99
+ // CHECK: %[[numiter_j:.*]] = arith.ceildivsi {{.*}}, %[[orig_step_j]]
103
100
104
101
// New bounds of the outer scf.
105
102
// CHECK: %[[range:.*]] = arith.muli %[[numiter_i]], %[[numiter_j]]
@@ -135,13 +132,9 @@ func.func @parametric(%lb1 : index, %ub1 : index, %step1 : index,
135
132
// Compute the number of iterations for each of the loops and the total
136
133
// number of iterations.
137
134
// CHECK: %[[range1:.*]] = arith.subi %[[orig_ub1]], %[[orig_lb1]]
138
- // CHECK: %[[orig_step1_minus_1:.*]] = arith.subi %[[orig_step1]], %c1
139
- // CHECK: %[[dividend1:.*]] = arith.addi %[[range1]], %[[orig_step1_minus_1]]
140
- // CHECK: %[[numiter1:.*]] = arith.divui %[[dividend1]], %[[orig_step1]]
135
+ // CHECK: %[[numiter1:.*]] = arith.ceildivsi %[[range1]], %[[orig_step1]]
141
136
// CHECK: %[[range2:.*]] = arith.subi %[[orig_ub2]], %[[orig_lb2]]
142
- // CHECK: %[[orig_step2_minus_1:.*]] = arith.subi %arg5, %c1
143
- // CHECK: %[[dividend2:.*]] = arith.addi %[[range2]], %[[orig_step2_minus_1]]
144
- // CHECK: %[[numiter2:.*]] = arith.divui %[[dividend2]], %[[orig_step2]]
137
+ // CHECK: %[[numiter2:.*]] = arith.ceildivsi %[[range2]], %[[orig_step2]]
145
138
// CHECK: %[[range:.*]] = arith.muli %[[numiter1]], %[[numiter2]] : index
146
139
147
140
// Check that the outer loop is updated.
0 commit comments