Skip to content

Commit 93592b7

Browse files
committed
[mlir][OpFormatGen] Format enum attribute cases as keywords when possible
In the overwhelmingly common case, enum attribute case strings represent valid identifiers in MLIR syntax. This revision updates the format generator to format as a keyword in these cases, removing the need to wrap values in a string. The parser still retains the ability to parse the string form, but the printer will use the keyword form when applicable. Differential Revision: https://reviews.llvm.org/D94575
1 parent 00a61b3 commit 93592b7

File tree

60 files changed

+816
-712
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+816
-712
lines changed

mlir/integration_test/Dialect/Linalg/CPU/matmul-vs-matvec.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func @main() {
5555
scf.for %j = %c0 to %n step %c1 {
5656
%e1 = load %C1[%i, %j] : memref<?x?xf32>
5757
%e2 = load %C2[%i, %j] : memref<?x?xf32>
58-
%c = cmpf "oeq", %e1, %e2 : f32
58+
%c = cmpf oeq, %e1, %e2 : f32
5959
assert %c, "Matmul does not produce same output as matvec"
6060
}
6161
}

mlir/test/Analysis/test-dominance.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func @func_condBranch(%cond : i1) {
5151
func @func_loop(%arg0 : i32, %arg1 : i32) {
5252
br ^loopHeader(%arg0 : i32)
5353
^loopHeader(%counter : i32):
54-
%lessThan = cmpi "slt", %counter, %arg1 : i32
54+
%lessThan = cmpi slt, %counter, %arg1 : i32
5555
cond_br %lessThan, ^loopBody, ^exit
5656
^loopBody:
5757
%const0 = constant 1 : i32
@@ -155,7 +155,7 @@ func @func_loop_nested_region(
155155
%arg4 : index) {
156156
br ^loopHeader(%arg0 : i32)
157157
^loopHeader(%counter : i32):
158-
%lessThan = cmpi "slt", %counter, %arg1 : i32
158+
%lessThan = cmpi slt, %counter, %arg1 : i32
159159
cond_br %lessThan, ^loopBody, ^exit
160160
^loopBody:
161161
%const0 = constant 1 : i32

mlir/test/Analysis/test-liveness.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func @func_loop(%arg0 : i32, %arg1 : i32) -> i32 {
8484
// CHECK-NEXT: %2 = cmpi
8585
// CHECK-NEXT: cond_br
8686
// CHECK-NEXT: EndLiveness
87-
%lessThan = cmpi "slt", %counter, %arg1 : i32
87+
%lessThan = cmpi slt, %counter, %arg1 : i32
8888
cond_br %lessThan, ^loopBody(%i : i32), ^exit(%i : i32)
8989
^loopBody(%val : i32):
9090
// CHECK: Block: 2

mlir/test/Conversion/AffineToStandard/lower-affine.mlir

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func private @get_idx() -> (index)
159159
// CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
160160
// CHECK-NEXT: %[[c20:.*]] = constant 20 : index
161161
// CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
162-
// CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
162+
// CHECK-NEXT: %[[v3:.*]] = cmpi sge, %[[v2]], %[[c0]] : index
163163
// CHECK-NEXT: if %[[v3]] {
164164
// CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
165165
// CHECK-NEXT: }
@@ -180,7 +180,7 @@ func @if_only() {
180180
// CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
181181
// CHECK-NEXT: %[[c20:.*]] = constant 20 : index
182182
// CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
183-
// CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
183+
// CHECK-NEXT: %[[v3:.*]] = cmpi sge, %[[v2]], %[[c0]] : index
184184
// CHECK-NEXT: if %[[v3]] {
185185
// CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
186186
// CHECK-NEXT: } else {
@@ -205,20 +205,20 @@ func @if_else() {
205205
// CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
206206
// CHECK-NEXT: %[[c20:.*]] = constant 20 : index
207207
// CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
208-
// CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
208+
// CHECK-NEXT: %[[v3:.*]] = cmpi sge, %[[v2]], %[[c0]] : index
209209
// CHECK-NEXT: if %[[v3]] {
210210
// CHECK-NEXT: %[[c0_0:.*]] = constant 0 : index
211211
// CHECK-NEXT: %[[cm10:.*]] = constant -10 : index
212212
// CHECK-NEXT: %[[v4:.*]] = addi %[[v0]], %[[cm10]] : index
213-
// CHECK-NEXT: %[[v5:.*]] = cmpi "sge", %[[v4]], %[[c0_0]] : index
213+
// CHECK-NEXT: %[[v5:.*]] = cmpi sge, %[[v4]], %[[c0_0]] : index
214214
// CHECK-NEXT: if %[[v5]] {
215215
// CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
216216
// CHECK-NEXT: }
217217
// CHECK-NEXT: } else {
218218
// CHECK-NEXT: %[[c0_0:.*]] = constant 0 : index
219219
// CHECK-NEXT: %[[cm10:.*]] = constant -10 : index
220220
// CHECK-NEXT: %{{.*}} = addi %[[v0]], %[[cm10]] : index
221-
// CHECK-NEXT: %{{.*}} = cmpi "sge", %{{.*}}, %[[c0_0]] : index
221+
// CHECK-NEXT: %{{.*}} = cmpi sge, %{{.*}}, %[[c0_0]] : index
222222
// CHECK-NEXT: if %{{.*}} {
223223
// CHECK-NEXT: call @mid(%[[v0:.*]]) : (index) -> ()
224224
// CHECK-NEXT: }
@@ -249,22 +249,22 @@ func @nested_ifs() {
249249
// CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %{{.*}} : index
250250
// CHECK-NEXT: %[[c1:.*]] = constant 1 : index
251251
// CHECK-NEXT: %[[v3:.*]] = addi %[[v2]], %[[c1]] : index
252-
// CHECK-NEXT: %[[v4:.*]] = cmpi "sge", %[[v3]], %[[c0]] : index
252+
// CHECK-NEXT: %[[v4:.*]] = cmpi sge, %[[v3]], %[[c0]] : index
253253
// CHECK-NEXT: %[[cm1_0:.*]] = constant -1 : index
254254
// CHECK-NEXT: %[[v5:.*]] = addi %{{.*}}, %[[cm1_0]] : index
255-
// CHECK-NEXT: %[[v6:.*]] = cmpi "sge", %[[v5]], %[[c0]] : index
255+
// CHECK-NEXT: %[[v6:.*]] = cmpi sge, %[[v5]], %[[c0]] : index
256256
// CHECK-NEXT: %[[v7:.*]] = and %[[v4]], %[[v6]] : i1
257257
// CHECK-NEXT: %[[cm1_1:.*]] = constant -1 : index
258258
// CHECK-NEXT: %[[v8:.*]] = addi %{{.*}}, %[[cm1_1]] : index
259-
// CHECK-NEXT: %[[v9:.*]] = cmpi "sge", %[[v8]], %[[c0]] : index
259+
// CHECK-NEXT: %[[v9:.*]] = cmpi sge, %[[v8]], %[[c0]] : index
260260
// CHECK-NEXT: %[[v10:.*]] = and %[[v7]], %[[v9]] : i1
261261
// CHECK-NEXT: %[[cm1_2:.*]] = constant -1 : index
262262
// CHECK-NEXT: %[[v11:.*]] = addi %{{.*}}, %[[cm1_2]] : index
263-
// CHECK-NEXT: %[[v12:.*]] = cmpi "sge", %[[v11]], %[[c0]] : index
263+
// CHECK-NEXT: %[[v12:.*]] = cmpi sge, %[[v11]], %[[c0]] : index
264264
// CHECK-NEXT: %[[v13:.*]] = and %[[v10]], %[[v12]] : i1
265265
// CHECK-NEXT: %[[cm42:.*]] = constant -42 : index
266266
// CHECK-NEXT: %[[v14:.*]] = addi %{{.*}}, %[[cm42]] : index
267-
// CHECK-NEXT: %[[v15:.*]] = cmpi "eq", %[[v14]], %[[c0]] : index
267+
// CHECK-NEXT: %[[v15:.*]] = cmpi eq, %[[v14]], %[[c0]] : index
268268
// CHECK-NEXT: %[[v16:.*]] = and %[[v13]], %[[v15]] : i1
269269
// CHECK-NEXT: if %[[v16]] {
270270
// CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
@@ -292,7 +292,7 @@ func @if_for() {
292292
// CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
293293
// CHECK-NEXT: %[[c20:.*]] = constant 20 : index
294294
// CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
295-
// CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
295+
// CHECK-NEXT: %[[v3:.*]] = cmpi sge, %[[v2]], %[[c0]] : index
296296
// CHECK-NEXT: if %[[v3]] {
297297
// CHECK-NEXT: %[[c0:.*]]{{.*}} = constant 0 : index
298298
// CHECK-NEXT: %[[c42:.*]]{{.*}} = constant 42 : index
@@ -301,7 +301,7 @@ func @if_for() {
301301
// CHECK-NEXT: %[[c0_:.*]]{{.*}} = constant 0 : index
302302
// CHECK-NEXT: %[[cm10:.*]] = constant -10 : index
303303
// CHECK-NEXT: %[[v4:.*]] = addi %{{.*}}, %[[cm10]] : index
304-
// CHECK-NEXT: %[[v5:.*]] = cmpi "sge", %[[v4]], %[[c0_:.*]]{{.*}} : index
304+
// CHECK-NEXT: %[[v5:.*]] = cmpi sge, %[[v4]], %[[c0_:.*]]{{.*}} : index
305305
// CHECK-NEXT: if %[[v5]] {
306306
// CHECK-NEXT: call @body2(%[[v0]], %{{.*}}) : (index, index) -> ()
307307
affine.if #set1(%i) {
@@ -318,7 +318,7 @@ func @if_for() {
318318
// CHECK-NEXT: %[[c0:.*]]{{.*}} = constant 0 : index
319319
// CHECK-NEXT: %[[cm10:.*]]{{.*}} = constant -10 : index
320320
// CHECK-NEXT: %{{.*}} = addi %{{.*}}, %[[cm10:.*]]{{.*}} : index
321-
// CHECK-NEXT: %{{.*}} = cmpi "sge", %{{.*}}, %[[c0:.*]]{{.*}} : index
321+
// CHECK-NEXT: %{{.*}} = cmpi sge, %{{.*}}, %[[c0:.*]]{{.*}} : index
322322
// CHECK-NEXT: if %{{.*}} {
323323
// CHECK-NEXT: %[[c0_:.*]]{{.*}} = constant 0 : index
324324
// CHECK-NEXT: %[[c42_:.*]]{{.*}} = constant 42 : index
@@ -346,11 +346,11 @@ func @if_for() {
346346
// CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
347347
// CHECK-NEXT: %[[a:.*]] = muli %{{.*}}, %[[cm1]] : index
348348
// CHECK-NEXT: %[[b:.*]] = addi %[[a]], %{{.*}} : index
349-
// CHECK-NEXT: %[[c:.*]] = cmpi "sgt", %{{.*}}, %[[b]] : index
349+
// CHECK-NEXT: %[[c:.*]] = cmpi sgt, %{{.*}}, %[[b]] : index
350350
// CHECK-NEXT: %[[d:.*]] = select %[[c]], %{{.*}}, %[[b]] : index
351351
// CHECK-NEXT: %[[c10:.*]] = constant 10 : index
352352
// CHECK-NEXT: %[[e:.*]] = addi %{{.*}}, %[[c10]] : index
353-
// CHECK-NEXT: %[[f:.*]] = cmpi "slt", %{{.*}}, %[[e]] : index
353+
// CHECK-NEXT: %[[f:.*]] = cmpi slt, %{{.*}}, %[[e]] : index
354354
// CHECK-NEXT: %[[g:.*]] = select %[[f]], %{{.*}}, %[[e]] : index
355355
// CHECK-NEXT: %[[c1_0:.*]] = constant 1 : index
356356
// CHECK-NEXT: for %{{.*}} = %[[d]] to %[[g]] step %[[c1_0]] {
@@ -370,22 +370,22 @@ func @loop_min_max(%N : index) {
370370

371371
#map_7_values = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1, d2, d3, d4, d5, d6)>
372372

373-
// Check that the "min" (cmpi "slt" + select) reduction sequence is emitted
373+
// Check that the "min" (cmpi slt + select) reduction sequence is emitted
374374
// correctly for an affine map with 7 results.
375375

376376
// CHECK-LABEL: func @min_reduction_tree
377377
// CHECK-NEXT: %[[c0:.*]] = constant 0 : index
378-
// CHECK-NEXT: %[[c01:.+]] = cmpi "slt", %{{.*}}, %{{.*}} : index
378+
// CHECK-NEXT: %[[c01:.+]] = cmpi slt, %{{.*}}, %{{.*}} : index
379379
// CHECK-NEXT: %[[r01:.+]] = select %[[c01]], %{{.*}}, %{{.*}} : index
380-
// CHECK-NEXT: %[[c012:.+]] = cmpi "slt", %[[r01]], %{{.*}} : index
380+
// CHECK-NEXT: %[[c012:.+]] = cmpi slt, %[[r01]], %{{.*}} : index
381381
// CHECK-NEXT: %[[r012:.+]] = select %[[c012]], %[[r01]], %{{.*}} : index
382-
// CHECK-NEXT: %[[c0123:.+]] = cmpi "slt", %[[r012]], %{{.*}} : index
382+
// CHECK-NEXT: %[[c0123:.+]] = cmpi slt, %[[r012]], %{{.*}} : index
383383
// CHECK-NEXT: %[[r0123:.+]] = select %[[c0123]], %[[r012]], %{{.*}} : index
384-
// CHECK-NEXT: %[[c01234:.+]] = cmpi "slt", %[[r0123]], %{{.*}} : index
384+
// CHECK-NEXT: %[[c01234:.+]] = cmpi slt, %[[r0123]], %{{.*}} : index
385385
// CHECK-NEXT: %[[r01234:.+]] = select %[[c01234]], %[[r0123]], %{{.*}} : index
386-
// CHECK-NEXT: %[[c012345:.+]] = cmpi "slt", %[[r01234]], %{{.*}} : index
386+
// CHECK-NEXT: %[[c012345:.+]] = cmpi slt, %[[r01234]], %{{.*}} : index
387387
// CHECK-NEXT: %[[r012345:.+]] = select %[[c012345]], %[[r01234]], %{{.*}} : index
388-
// CHECK-NEXT: %[[c0123456:.+]] = cmpi "slt", %[[r012345]], %{{.*}} : index
388+
// CHECK-NEXT: %[[c0123456:.+]] = cmpi slt, %[[r012345]], %{{.*}} : index
389389
// CHECK-NEXT: %[[r0123456:.+]] = select %[[c0123456]], %[[r012345]], %{{.*}} : index
390390
// CHECK-NEXT: %[[c1:.*]] = constant 1 : index
391391
// CHECK-NEXT: for %{{.*}} = %[[c0]] to %[[r0123456]] step %[[c1]] {
@@ -478,7 +478,7 @@ func @affine_apply_mod(%arg0 : index) -> (index) {
478478
// CHECK-NEXT: %[[c42:.*]] = constant 42 : index
479479
// CHECK-NEXT: %[[v0:.*]] = remi_signed %{{.*}}, %[[c42]] : index
480480
// CHECK-NEXT: %[[c0:.*]] = constant 0 : index
481-
// CHECK-NEXT: %[[v1:.*]] = cmpi "slt", %[[v0]], %[[c0]] : index
481+
// CHECK-NEXT: %[[v1:.*]] = cmpi slt, %[[v0]], %[[c0]] : index
482482
// CHECK-NEXT: %[[v2:.*]] = addi %[[v0]], %[[c42]] : index
483483
// CHECK-NEXT: %[[v3:.*]] = select %[[v1]], %[[v2]], %[[v0]] : index
484484
%0 = affine.apply #mapmod (%arg0)
@@ -497,7 +497,7 @@ func @affine_apply_floordiv(%arg0 : index) -> (index) {
497497
// CHECK-NEXT: %[[c42:.*]] = constant 42 : index
498498
// CHECK-NEXT: %[[c0:.*]] = constant 0 : index
499499
// CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
500-
// CHECK-NEXT: %[[v0:.*]] = cmpi "slt", %{{.*}}, %[[c0]] : index
500+
// CHECK-NEXT: %[[v0:.*]] = cmpi slt, %{{.*}}, %[[c0]] : index
501501
// CHECK-NEXT: %[[v1:.*]] = subi %[[cm1]], %{{.*}} : index
502502
// CHECK-NEXT: %[[v2:.*]] = select %[[v0]], %[[v1]], %{{.*}} : index
503503
// CHECK-NEXT: %[[v3:.*]] = divi_signed %[[v2]], %[[c42]] : index
@@ -519,7 +519,7 @@ func @affine_apply_ceildiv(%arg0 : index) -> (index) {
519519
// CHECK-NEXT: %[[c42:.*]] = constant 42 : index
520520
// CHECK-NEXT: %[[c0:.*]] = constant 0 : index
521521
// CHECK-NEXT: %[[c1:.*]] = constant 1 : index
522-
// CHECK-NEXT: %[[v0:.*]] = cmpi "sle", %{{.*}}, %[[c0]] : index
522+
// CHECK-NEXT: %[[v0:.*]] = cmpi sle, %{{.*}}, %[[c0]] : index
523523
// CHECK-NEXT: %[[v1:.*]] = subi %[[c0]], %{{.*}} : index
524524
// CHECK-NEXT: %[[v2:.*]] = subi %{{.*}}, %[[c1]] : index
525525
// CHECK-NEXT: %[[v3:.*]] = select %[[v0]], %[[v1]], %[[v2]] : index
@@ -624,7 +624,7 @@ func @affine_min(%arg0: index, %arg1: index) -> index{
624624
// CHECK: %[[Cm2:.*]] = constant -1
625625
// CHECK: %[[neg2:.*]] = muli %[[ARG0]], %[[Cm2:.*]]
626626
// CHECK: %[[second:.*]] = addi %[[ARG1]], %[[neg2]]
627-
// CHECK: %[[cmp:.*]] = cmpi "slt", %[[first]], %[[second]]
627+
// CHECK: %[[cmp:.*]] = cmpi slt, %[[first]], %[[second]]
628628
// CHECK: select %[[cmp]], %[[first]], %[[second]]
629629
%0 = affine.min affine_map<(d0,d1) -> (d0 - d1, d1 - d0)>(%arg0, %arg1)
630630
return %0 : index
@@ -639,7 +639,7 @@ func @affine_max(%arg0: index, %arg1: index) -> index{
639639
// CHECK: %[[Cm2:.*]] = constant -1
640640
// CHECK: %[[neg2:.*]] = muli %[[ARG0]], %[[Cm2:.*]]
641641
// CHECK: %[[second:.*]] = addi %[[ARG1]], %[[neg2]]
642-
// CHECK: %[[cmp:.*]] = cmpi "sgt", %[[first]], %[[second]]
642+
// CHECK: %[[cmp:.*]] = cmpi sgt, %[[first]], %[[second]]
643643
// CHECK: select %[[cmp]], %[[first]], %[[second]]
644644
%0 = affine.max affine_map<(d0,d1) -> (d0 - d1, d1 - d0)>(%arg0, %arg1)
645645
return %0 : index

mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module attributes {
3232
// CHECK: %[[ADD:.+]] = spv.GroupNonUniformIAdd "Subgroup" "Reduce" %[[VAL]] : i32
3333

3434
// CHECK: %[[OUTPTR:.+]] = spv.AccessChain %[[OUTPUT]][%[[ZERO]], %[[ZERO]]]
35-
// CHECK: %[[ELECT:.+]] = spv.GroupNonUniformElect "Subgroup" : i1
35+
// CHECK: %[[ELECT:.+]] = spv.GroupNonUniformElect Subgroup : i1
3636

3737
// CHECK: spv.selection {
3838
// CHECK: spv.BranchConditional %[[ELECT]], ^bb1, ^bb2

mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func @branch_loop() {
1111
// CHECK-NEXT: ^[[BB1]](%[[ARG1:[0-9]+]]: i64, %[[ARG2:[0-9]+]]: i64):{{.*}}
1212
^bb1(%0: index, %1: index):
1313
// CHECK-NEXT: %[[CMP:[0-9]+]] = llvm.icmp "slt" %[[ARG1]], %[[ARG2]] : i64
14-
%2 = cmpi "slt", %0, %1 : index
14+
%2 = cmpi slt, %0, %1 : index
1515
// CHECK-NEXT: llvm.cond_br %[[CMP]], ^[[BB2:.*]](%{{[0-9]+}}, %{{[0-9]+}} : i64, i64), ^[[BB3:.*]]
1616
cond_br %2, ^bb2(%end, %end : index, index), ^bb3
1717
// CHECK-NEXT: ^[[BB2]](%[[ARG3:[0-9]+]]: i64, %[[ARG4:[0-9]+]]: i64):

mlir/test/Conversion/SCFToGPU/parallel_loop.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ module {
284284
// CHECK: [[VAL_43:%.*]] = affine.min #[[$MAP4]]([[VAL_29]]){{\[}}[[VAL_42]]]
285285
// CHECK: [[VAL_44:%.*]] = subview [[VAL_2]]{{\[}}[[VAL_28]], [[VAL_29]]] {{\[}}[[VAL_41]], [[VAL_43]]] {{\[}}%[[C1]], %[[C1]]] : memref<?x?xf32, #[[$MAP0]]> to memref<?x?xf32, #[[$MAP5]]>
286286
// CHECK: [[VAL_45:%.*]] = affine.apply #[[$MAP2]]([[VAL_22]]){{\[}}%[[C1]], %[[C0]]]
287-
// CHECK: [[VAL_46:%.*]] = cmpi "slt", [[VAL_45]], [[VAL_31_SQUARED]] : index
287+
// CHECK: [[VAL_46:%.*]] = cmpi slt, [[VAL_45]], [[VAL_31_SQUARED]] : index
288288
// CHECK: scf.if [[VAL_46]] {
289289
// CHECK: [[VAL_47:%.*]] = affine.apply #[[$MAP2]]([[VAL_23]]){{\[}}%[[C1]], %[[C0]]]
290-
// CHECK: [[VAL_48:%.*]] = cmpi "slt", [[VAL_47]], [[VAL_33]] : index
290+
// CHECK: [[VAL_48:%.*]] = cmpi slt, [[VAL_47]], [[VAL_33]] : index
291291
// CHECK: scf.if [[VAL_48]] {
292292
// CHECK: [[VAL_49:%.*]] = load [[VAL_34]]{{\[}}[[VAL_45]], [[VAL_47]]] : memref<?x?xf32, #[[$MAP5]]>
293293
// CHECK: [[VAL_50:%.*]] = load [[VAL_39]]{{\[}}[[VAL_45]], [[VAL_47]]] : memref<?x?xf32, #[[$MAP5]]>

mlir/test/Conversion/SCFToStandard/convert-to-cfg.mlir

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// CHECK-LABEL: func @simple_std_for_loop(%{{.*}}: index, %{{.*}}: index, %{{.*}}: index) {
44
// CHECK-NEXT: br ^bb1(%{{.*}} : index)
55
// CHECK-NEXT: ^bb1(%{{.*}}: index): // 2 preds: ^bb0, ^bb2
6-
// CHECK-NEXT: %{{.*}} = cmpi "slt", %{{.*}}, %{{.*}} : index
6+
// CHECK-NEXT: %{{.*}} = cmpi slt, %{{.*}}, %{{.*}} : index
77
// CHECK-NEXT: cond_br %{{.*}}, ^bb2, ^bb3
88
// CHECK-NEXT: ^bb2: // pred: ^bb1
99
// CHECK-NEXT: %{{.*}} = constant 1 : index
@@ -21,13 +21,13 @@ func @simple_std_for_loop(%arg0 : index, %arg1 : index, %arg2 : index) {
2121
// CHECK-LABEL: func @simple_std_2_for_loops(%{{.*}}: index, %{{.*}}: index, %{{.*}}: index) {
2222
// CHECK-NEXT: br ^bb1(%{{.*}} : index)
2323
// CHECK-NEXT: ^bb1(%[[ub0:.*]]: index): // 2 preds: ^bb0, ^bb5
24-
// CHECK-NEXT: %[[cond0:.*]] = cmpi "slt", %[[ub0]], %{{.*}} : index
24+
// CHECK-NEXT: %[[cond0:.*]] = cmpi slt, %[[ub0]], %{{.*}} : index
2525
// CHECK-NEXT: cond_br %[[cond0]], ^bb2, ^bb6
2626
// CHECK-NEXT: ^bb2: // pred: ^bb1
2727
// CHECK-NEXT: %{{.*}} = constant 1 : index
2828
// CHECK-NEXT: br ^bb3(%{{.*}} : index)
2929
// CHECK-NEXT: ^bb3(%[[ub1:.*]]: index): // 2 preds: ^bb2, ^bb4
30-
// CHECK-NEXT: %[[cond1:.*]] = cmpi "slt", %{{.*}}, %{{.*}} : index
30+
// CHECK-NEXT: %[[cond1:.*]] = cmpi slt, %{{.*}}, %{{.*}} : index
3131
// CHECK-NEXT: cond_br %[[cond1]], ^bb4, ^bb5
3232
// CHECK-NEXT: ^bb4: // pred: ^bb3
3333
// CHECK-NEXT: %{{.*}} = constant 1 : index
@@ -111,7 +111,7 @@ func @simple_std_2_ifs(%arg0: i1) {
111111
// CHECK-LABEL: func @simple_std_for_loop_with_2_ifs(%{{.*}}: index, %{{.*}}: index, %{{.*}}: index, %{{.*}}: i1) {
112112
// CHECK-NEXT: br ^bb1(%{{.*}} : index)
113113
// CHECK-NEXT: ^bb1(%{{.*}}: index): // 2 preds: ^bb0, ^bb7
114-
// CHECK-NEXT: %{{.*}} = cmpi "slt", %{{.*}}, %{{.*}} : index
114+
// CHECK-NEXT: %{{.*}} = cmpi slt, %{{.*}}, %{{.*}} : index
115115
// CHECK-NEXT: cond_br %{{.*}}, ^bb2, ^bb8
116116
// CHECK-NEXT: ^bb2: // pred: ^bb1
117117
// CHECK-NEXT: %{{.*}} = constant 1 : index
@@ -230,12 +230,12 @@ func @nested_if_yield(%arg0: i1) -> (index) {
230230
// CHECK: [[VAL_5:%.*]] = constant 1 : index
231231
// CHECK: br ^bb1([[VAL_0]] : index)
232232
// CHECK: ^bb1([[VAL_6:%.*]]: index):
233-
// CHECK: [[VAL_7:%.*]] = cmpi "slt", [[VAL_6]], [[VAL_2]] : index
233+
// CHECK: [[VAL_7:%.*]] = cmpi slt, [[VAL_6]], [[VAL_2]] : index
234234
// CHECK: cond_br [[VAL_7]], ^bb2, ^bb6
235235
// CHECK: ^bb2:
236236
// CHECK: br ^bb3([[VAL_1]] : index)
237237
// CHECK: ^bb3([[VAL_8:%.*]]: index):
238-
// CHECK: [[VAL_9:%.*]] = cmpi "slt", [[VAL_8]], [[VAL_3]] : index
238+
// CHECK: [[VAL_9:%.*]] = cmpi slt, [[VAL_8]], [[VAL_3]] : index
239239
// CHECK: cond_br [[VAL_9]], ^bb4, ^bb5
240240
// CHECK: ^bb4:
241241
// CHECK: [[VAL_10:%.*]] = constant 1 : index
@@ -265,7 +265,7 @@ func @parallel_loop(%arg0 : index, %arg1 : index, %arg2 : index,
265265
// CHECK: br ^[[COND:.*]](%[[LB]], %[[INIT0]], %[[INIT1]] : index, f32, f32)
266266
//
267267
// CHECK: ^[[COND]](%[[ITER:.*]]: index, %[[ITER_ARG0:.*]]: f32, %[[ITER_ARG1:.*]]: f32):
268-
// CHECK: %[[CMP:.*]] = cmpi "slt", %[[ITER]], %[[UB]] : index
268+
// CHECK: %[[CMP:.*]] = cmpi slt, %[[ITER]], %[[UB]] : index
269269
// CHECK: cond_br %[[CMP]], ^[[BODY:.*]], ^[[CONTINUE:.*]]
270270
//
271271
// CHECK: ^[[BODY]]:
@@ -330,7 +330,7 @@ func @simple_parallel_reduce_loop(%arg0: index, %arg1: index,
330330
// Condition branch takes as arguments the current value of the iteration
331331
// variable and the current partially reduced value.
332332
// CHECK: ^[[COND]](%[[ITER:.*]]: index, %[[ITER_ARG:.*]]: f32
333-
// CHECK: %[[COMP:.*]] = cmpi "slt", %[[ITER]], %[[UB]]
333+
// CHECK: %[[COMP:.*]] = cmpi slt, %[[ITER]], %[[UB]]
334334
// CHECK: cond_br %[[COMP]], ^[[BODY:.*]], ^[[CONTINUE:.*]]
335335

336336
// Bodies of scf.reduce operations are folded into the main loop body. The
@@ -551,7 +551,7 @@ func @nested_while_ops(%arg0: f32) -> i64 {
551551
func @ifs_in_parallel(%arg1: index, %arg2: index, %arg3: index, %arg4: i1, %arg5: i1) {
552552
// CHECK: br ^[[LOOP_LATCH:.*]](%[[ARG0]] : index)
553553
// CHECK: ^[[LOOP_LATCH]](%[[LOOP_IV:.*]]: index):
554-
// CHECK: %[[LOOP_COND:.*]] = cmpi "slt", %[[LOOP_IV]], %[[ARG1]] : index
554+
// CHECK: %[[LOOP_COND:.*]] = cmpi slt, %[[LOOP_IV]], %[[ARG1]] : index
555555
// CHECK: cond_br %[[LOOP_COND]], ^[[LOOP_BODY:.*]], ^[[LOOP_CONT:.*]]
556556
// CHECK: ^[[LOOP_BODY]]:
557557
// CHECK: cond_br %[[ARG3]], ^[[IF1_THEN:.*]], ^[[IF1_CONT:.*]]

0 commit comments

Comments
 (0)