diff --git a/mlir/include/mlir/Transforms/Passes.td b/mlir/include/mlir/Transforms/Passes.td --- a/mlir/include/mlir/Transforms/Passes.td +++ b/mlir/include/mlir/Transforms/Passes.td @@ -364,7 +364,7 @@ let constructor = "mlir::createCanonicalizerPass()"; let options = [ Option<"topDownProcessingEnabled", "top-down", "bool", - /*default=*/"false", + /*default=*/"true", "Seed the worklist in general top-down order">, Option<"enableRegionSimplification", "region-simplify", "bool", /*default=*/"true", diff --git a/mlir/test/Conversion/MathToLLVM/convert-to-libm.mlir b/mlir/test/Conversion/MathToLLVM/convert-to-libm.mlir --- a/mlir/test/Conversion/MathToLLVM/convert-to-libm.mlir +++ b/mlir/test/Conversion/MathToLLVM/convert-to-libm.mlir @@ -52,10 +52,10 @@ // CHECK-LABEL: func @expm1_vec_caller( // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>, // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) { -// CHECK: %[[CVF:.*]] = constant dense<0.000000e+00> : vector<2xf32> -// CHECK: %[[CVD:.*]] = constant dense<0.000000e+00> : vector<2xf64> -// CHECK: %[[C0:.*]] = constant 0 : i32 -// CHECK: %[[C1:.*]] = constant 1 : i32 +// CHECK-DAG: %[[CVF:.*]] = constant dense<0.000000e+00> : vector<2xf32> +// CHECK-DAG: %[[CVD:.*]] = constant dense<0.000000e+00> : vector<2xf64> +// CHECK-DAG: %[[C0:.*]] = constant 0 : i32 +// CHECK-DAG: %[[C1:.*]] = constant 1 : i32 // CHECK: %[[IN0_F32:.*]] = vector.extractelement %[[VAL_0]]{{\[}}%[[C0]] : i32] : vector<2xf32> // CHECK: %[[OUT0_F32:.*]] = call @expm1f(%[[IN0_F32]]) : (f32) -> f32 // CHECK: %[[VAL_8:.*]] = vector.insertelement %[[OUT0_F32]], %[[CVF]]{{\[}}%[[C0]] : i32] : vector<2xf32> diff --git a/mlir/test/Dialect/Affine/canonicalize.mlir b/mlir/test/Dialect/Affine/canonicalize.mlir --- a/mlir/test/Dialect/Affine/canonicalize.mlir +++ b/mlir/test/Dialect/Affine/canonicalize.mlir @@ -204,7 +204,7 @@ // ----- -// CHECK-DAG: #[[$MAP14:.*]] = affine_map<()[s0, s1] -> (((s1 + s0) * 4) floordiv s0)> +// CHECK-DAG: #[[$MAP14:.*]] = affine_map<()[s0, s1] -> ((s0 * 4 + s1 * 4) floordiv s0)> // CHECK-LABEL: func @compose_affine_maps_multiple_symbols func @compose_affine_maps_multiple_symbols(%arg0: index, %arg1: index) -> index { @@ -309,7 +309,7 @@ // ----- -// CHECK-DAG: #[[$MAP_symbolic_composition_d:.*]] = affine_map<()[s0, s1] -> (s0 + s1 * 3)> +// CHECK-DAG: #[[$MAP_symbolic_composition_d:.*]] = affine_map<()[s0, s1] -> (s0 * 3 + s1)> // CHECK-LABEL: func @symbolic_composition_d( // CHECK-SAME: %[[ARG0:[0-9a-zA-Z]+]]: index @@ -318,7 +318,7 @@ %0 = affine.apply affine_map<(d0) -> (d0)>(%arg0) %1 = affine.apply affine_map<()[s0] -> (s0)>()[%arg1] %2 = affine.apply affine_map<()[s0, s1, s2, s3] -> (s0 + s1 + s2 + s3)>()[%0, %0, %0, %1] - // CHECK: %{{.*}} = affine.apply #[[$MAP_symbolic_composition_d]]()[%[[ARG1]], %[[ARG0]]] + // CHECK: %{{.*}} = affine.apply #[[$MAP_symbolic_composition_d]]()[%[[ARG0]], %[[ARG1]]] return %2 : index } @@ -719,7 +719,7 @@ // ----- // CHECK-DAG: #[[MAP0:.+]] = affine_map<()[s0, s1, s2] -> (s0 * 3, 16, -s1 + s2)> -// CHECK-DAG: #[[MAP1:.+]] = affine_map<()[s0, s1, s2] -> (-s1 + 5, 16, -s0 + s2)> +// CHECK-DAG: #[[MAP1:.+]] = affine_map<()[s0, s1, s2] -> (-s2 + 5, 16, -s0 + s1)> // CHECK: func @merge_affine_min_ops // CHECK-SAME: (%[[I0:.+]]: index, %[[I1:.+]]: index, %[[I2:.+]]: index, %[[I3:.+]]: index) @@ -728,7 +728,7 @@ // CHECK: affine.min #[[MAP0]]()[%[[I2]], %[[I1]], %[[I0]]] %1 = affine.min affine_map<(d0)[s0] -> (3 * s0, d0)> (%0)[%i2] // Use as dim - // CHECK: affine.min #[[MAP1]]()[%[[I1]], %[[I3]], %[[I0]]] + // CHECK: affine.min #[[MAP1]]()[%[[I1]], %[[I0]], %[[I3]]] %2 = affine.min affine_map<(d0)[s0] -> (s0, 5 - d0)> (%i3)[%0] // Use as symbol return %1, %2: index, index @@ -788,7 +788,6 @@ return %1: index } - // ----- // CHECK-LABEL: func @dont_merge_affine_min_if_not_single_sym @@ -802,7 +801,7 @@ // ----- // CHECK-DAG: #[[MAP0:.+]] = affine_map<()[s0, s1, s2] -> (s0 * 3, 16, -s1 + s2)> -// CHECK-DAG: #[[MAP1:.+]] = affine_map<()[s0, s1, s2] -> (-s1 + 5, 16, -s0 + s2)> +// CHECK-DAG: #[[MAP1:.+]] = affine_map<()[s0, s1, s2] -> (-s2 + 5, 16, -s0 + s1)> // CHECK: func @merge_affine_max_ops // CHECK-SAME: (%[[I0:.+]]: index, %[[I1:.+]]: index, %[[I2:.+]]: index, %[[I3:.+]]: index) @@ -811,7 +810,7 @@ // CHECK: affine.max #[[MAP0]]()[%[[I2]], %[[I1]], %[[I0]]] %1 = affine.max affine_map<(d0)[s0] -> (3 * s0, d0)> (%0)[%i2] // Use as dim - // CHECK: affine.max #[[MAP1]]()[%[[I1]], %[[I3]], %[[I0]]] + // CHECK: affine.max #[[MAP1]]()[%[[I1]], %[[I0]], %[[I3]]] %2 = affine.max affine_map<(d0)[s0] -> (s0, 5 - d0)> (%i3)[%0] // Use as symbol return %1, %2: index, index diff --git a/mlir/test/Dialect/Linalg/bufferize.mlir b/mlir/test/Dialect/Linalg/bufferize.mlir --- a/mlir/test/Dialect/Linalg/bufferize.mlir +++ b/mlir/test/Dialect/Linalg/bufferize.mlir @@ -98,8 +98,8 @@ // CHECK-LABEL: func @dynamic_results( // CHECK-SAME: %[[ARG:.*]]: tensor -// CHECK: %[[C0:.*]] = constant 0 : index -// CHECK: %[[C1:.*]] = constant 1 : index +// CHECK-DAG: %[[C0:.*]] = constant 0 : index +// CHECK-DAG: %[[C1:.*]] = constant 1 : index // CHECK: %[[MEMREF_ARG:.*]] = memref.buffer_cast %[[ARG]] : memref // CHECK: %[[DIM0:.*]] = memref.dim %[[ARG]], %[[C0]] : tensor // CHECK: %[[DIM1:.*]] = memref.dim %[[ARG]], %[[C1]] : tensor @@ -206,8 +206,8 @@ (tensor, tensor) { %c0 = constant 0 : index %c1 = constant 1 : index - // CHECK-NEXT: %[[C0:.*]] = constant 0 : index - // CHECK-NEXT: %[[C1:.*]] = constant 1 : index + // CHECK-DAG: %[[C0:.*]] = constant 0 : index + // CHECK-DAG: %[[C1:.*]] = constant 1 : index %i0 = call @make_index() : () -> index // CHECK: %[[IDX:.*]] = call @make_index() : () -> index diff --git a/mlir/test/Dialect/Linalg/canonicalize.mlir b/mlir/test/Dialect/Linalg/canonicalize.mlir --- a/mlir/test/Dialect/Linalg/canonicalize.mlir +++ b/mlir/test/Dialect/Linalg/canonicalize.mlir @@ -1027,9 +1027,9 @@ // CHECK-SAME: %[[A:.*]]: [[BUF_TY:memref<48xf32>]], %[[B:.*]]: [[TY:tensor<48xf32>]], // CHECK-SAME: %[[C:.*]]: [[BUF_TY]], %[[C_TENSOR:.*]]: [[TY]]) -> [[TY]] { -// CHECK: %[[C0:.*]] = constant 0 : index -// CHECK: %[[C24:.*]] = constant 24 : index -// CHECK: %[[C48:.*]] = constant 48 : index +// CHECK-DAG: %[[C0:.*]] = constant 0 : index +// CHECK-DAG: %[[C24:.*]] = constant 24 : index +// CHECK-DAG: %[[C48:.*]] = constant 48 : index // CHECK-NOT: %{{.*}} = linalg.tiled_loop // CHECK: %[[RESULT:.*]] = linalg.tiled_loop (%{{.*}}) = (%[[C0]]) diff --git a/mlir/test/Dialect/Linalg/fusion-tensor-pattern.mlir b/mlir/test/Dialect/Linalg/fusion-tensor-pattern.mlir --- a/mlir/test/Dialect/Linalg/fusion-tensor-pattern.mlir +++ b/mlir/test/Dialect/Linalg/fusion-tensor-pattern.mlir @@ -98,11 +98,11 @@ // TLOOP-SAME: %[[C:[a-zA-Z0-9_]+]]: tensor, // TLOOP-SAME: %[[ABC_INIT:[a-zA-Z0-9_]+]]: tensor) -> tensor { -// TLOOP: %[[C32:.*]] = constant 32 : index -// TLOOP: %[[C64:.*]] = constant 64 : index -// TLOOP: %[[C16:.*]] = constant 16 : index -// TLOOP: %[[C0:.*]] = constant 0 : index -// TLOOP: %[[C1:.*]] = constant 1 : index +// TLOOP-DAG: %[[C32:.*]] = constant 32 : index +// TLOOP-DAG: %[[C64:.*]] = constant 64 : index +// TLOOP-DAG: %[[C16:.*]] = constant 16 : index +// TLOOP-DAG: %[[C0:.*]] = constant 0 : index +// TLOOP-DAG: %[[C1:.*]] = constant 1 : index // TLOOP: %[[DIM_A0:.*]] = memref.dim %[[A]], %[[C0]] : [[TY:.*]] @@ -208,10 +208,10 @@ // TLOOP-SAME: %[[B:[a-zA-Z0-9_]+]]: tensor, // TLOOP-SAME: %[[AB:[a-zA-Z0-9_]+]]: tensor -// TLOOP: %[[C32:.*]] = constant 32 : index -// TLOOP: %[[C64:.*]] = constant 64 : index -// TLOOP: %[[C0:.*]] = constant 0 : index -// TLOOP: %[[C1:.*]] = constant 1 : index +// TLOOP-DAG: %[[C32:.*]] = constant 32 : index +// TLOOP-DAG: %[[C64:.*]] = constant 64 : index +// TLOOP-DAG: %[[C0:.*]] = constant 0 : index +// TLOOP-DAG: %[[C1:.*]] = constant 1 : index // TLOOP: %[[DIM_A_0:.*]] = memref.dim %[[A]], %[[C0]] : [[TY:.*]] // TLOOP: %[[DIM_B_1:.*]] = memref.dim %[[B]], %[[C1]] : [[TY]] diff --git a/mlir/test/Dialect/SCF/canonicalize.mlir b/mlir/test/Dialect/SCF/canonicalize.mlir --- a/mlir/test/Dialect/SCF/canonicalize.mlir +++ b/mlir/test/Dialect/SCF/canonicalize.mlir @@ -122,9 +122,9 @@ } // CHECK-LABEL: func @nested_parallel( -// CHECK: [[C0:%.*]] = constant 0 : index -// CHECK: [[C1:%.*]] = constant 1 : index -// CHECK: [[C2:%.*]] = constant 2 : index +// CHECK-DAG: [[C0:%.*]] = constant 0 : index +// CHECK-DAG: [[C1:%.*]] = constant 1 : index +// CHECK-DAG: [[C2:%.*]] = constant 2 : index // CHECK: [[B0:%.*]] = memref.dim {{.*}}, [[C0]] // CHECK: [[B1:%.*]] = memref.dim {{.*}}, [[C1]] // CHECK: [[B2:%.*]] = memref.dim {{.*}}, [[C2]] @@ -150,8 +150,8 @@ } // CHECK-LABEL: func @one_unused -// CHECK: [[C0:%.*]] = constant 1 : index -// CHECK: [[C3:%.*]] = constant 3 : index +// CHECK-DAG: [[C0:%.*]] = constant 1 : index +// CHECK-DAG: [[C3:%.*]] = constant 3 : index // CHECK: [[V0:%.*]] = scf.if %{{.*}} -> (index) { // CHECK: call @side_effect() : () -> () // CHECK: scf.yield [[C0]] : index @@ -183,8 +183,8 @@ } // CHECK-LABEL: func @nested_unused -// CHECK: [[C0:%.*]] = constant 1 : index -// CHECK: [[C3:%.*]] = constant 3 : index +// CHECK-DAG: [[C0:%.*]] = constant 1 : index +// CHECK-DAG: [[C3:%.*]] = constant 3 : index // CHECK: [[V0:%.*]] = scf.if {{.*}} -> (index) { // CHECK: [[V1:%.*]] = scf.if {{.*}} -> (index) { // CHECK: call @side_effect() : () -> () @@ -264,8 +264,8 @@ } // CHECK-LABEL: func @to_select1 -// CHECK: [[C0:%.*]] = constant 0 : index -// CHECK: [[C1:%.*]] = constant 1 : index +// CHECK-DAG: [[C0:%.*]] = constant 0 : index +// CHECK-DAG: [[C1:%.*]] = constant 1 : index // CHECK: [[V0:%.*]] = select {{.*}}, [[C0]], [[C1]] // CHECK: return [[V0]] : index @@ -283,8 +283,8 @@ } // CHECK-LABEL: func @to_select_same_val -// CHECK: [[C0:%.*]] = constant 0 : index -// CHECK: [[C1:%.*]] = constant 1 : index +// CHECK-DAG: [[C0:%.*]] = constant 0 : index +// CHECK-DAG: [[C1:%.*]] = constant 1 : index // CHECK: [[V0:%.*]] = select {{.*}}, [[C0]], [[C1]] // CHECK: return [[V0]], [[C1]] : index, index @@ -304,10 +304,10 @@ } // CHECK-LABEL: func @to_select2 -// CHECK: [[C0:%.*]] = constant 0 : index -// CHECK: [[C1:%.*]] = constant 1 : index -// CHECK: [[C2:%.*]] = constant 2 : index -// CHECK: [[C3:%.*]] = constant 3 : index +// CHECK-DAG: [[C0:%.*]] = constant 0 : index +// CHECK-DAG: [[C1:%.*]] = constant 1 : index +// CHECK-DAG: [[C2:%.*]] = constant 2 : index +// CHECK-DAG: [[C3:%.*]] = constant 3 : index // CHECK: [[V0:%.*]] = select {{.*}}, [[C0]], [[C2]] // CHECK: [[V1:%.*]] = select {{.*}}, [[C1]], [[C3]] // CHECK: return [[V0]], [[V1]] : index diff --git a/mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir b/mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir --- a/mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir +++ b/mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir @@ -486,9 +486,9 @@ func @canonicalize_selection_op_scalar_type(%cond: i1) -> () { %0 = spv.Constant 0: i32 - // CHECK: %[[TRUE_VALUE:.*]] = spv.Constant 1 : i32 + // CHECK-DAG: %[[TRUE_VALUE:.*]] = spv.Constant 1 : i32 %1 = spv.Constant 1: i32 - // CHECK: %[[FALSE_VALUE:.*]] = spv.Constant 2 : i32 + // CHECK-DAG: %[[FALSE_VALUE:.*]] = spv.Constant 2 : i32 %2 = spv.Constant 2: i32 // CHECK: %[[DST_VAR:.*]] = spv.Variable init({{%.*}}) : !spv.ptr %3 = spv.Variable init(%0) : !spv.ptr @@ -517,9 +517,9 @@ func @canonicalize_selection_op_vector_type(%cond: i1) -> () { %0 = spv.Constant dense<[0, 1, 2]> : vector<3xi32> - // CHECK: %[[TRUE_VALUE:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> + // CHECK-DAG: %[[TRUE_VALUE:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> %1 = spv.Constant dense<[1, 2, 3]> : vector<3xi32> - // CHECK: %[[FALSE_VALUE:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> + // CHECK-DAG: %[[FALSE_VALUE:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> %2 = spv.Constant dense<[2, 3, 4]> : vector<3xi32> // CHECK: %[[DST_VAR:.*]] = spv.Variable init({{%.*}}) : !spv.ptr, Function> %3 = spv.Variable init(%0) : !spv.ptr, Function> @@ -590,9 +590,9 @@ // A conditional block consists of more than 2 operations. func @cannot_canonicalize_selection_op_1(%cond: i1) -> () { %0 = spv.Constant dense<[0, 1, 2]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> %1 = spv.Constant dense<[1, 2, 3]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> %2 = spv.Constant dense<[2, 3, 4]> : vector<3xi32> // CHECK: %[[DST_VAR_0:.*]] = spv.Variable init({{%.*}}) : !spv.ptr, Function> %3 = spv.Variable init(%0) : !spv.ptr, Function> @@ -628,9 +628,9 @@ // A control-flow goes into `^then` block from `^else` block. func @cannot_canonicalize_selection_op_2(%cond: i1) -> () { %0 = spv.Constant dense<[0, 1, 2]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> %1 = spv.Constant dense<[1, 2, 3]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> %2 = spv.Constant dense<[2, 3, 4]> : vector<3xi32> // CHECK: %[[DST_VAR:.*]] = spv.Variable init({{%.*}}) : !spv.ptr, Function> %3 = spv.Variable init(%0) : !spv.ptr, Function> @@ -663,8 +663,8 @@ func @cannot_canonicalize_selection_op_3(%cond: i1) -> () { %0 = spv.Constant dense<[0, 1, 2]> : vector<3xi32> %1 = spv.Constant dense<[1, 2, 3]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> %2 = spv.Constant dense<[2, 3, 4]> : vector<3xi32> // CHECK: %[[DST_VAR:.*]] = spv.Variable init({{%.*}}) : !spv.ptr, Function> %3 = spv.Variable init(%0) : !spv.ptr, Function> @@ -696,9 +696,9 @@ // Different memory access attributes. func @cannot_canonicalize_selection_op_4(%cond: i1) -> () { %0 = spv.Constant dense<[0, 1, 2]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_0:.*]] = spv.Constant dense<[1, 2, 3]> : vector<3xi32> %1 = spv.Constant dense<[1, 2, 3]> : vector<3xi32> - // CHECK: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> + // CHECK-DAG: %[[SRC_VALUE_1:.*]] = spv.Constant dense<[2, 3, 4]> : vector<3xi32> %2 = spv.Constant dense<[2, 3, 4]> : vector<3xi32> // CHECK: %[[DST_VAR:.*]] = spv.Variable init({{%.*}}) : !spv.ptr, Function> %3 = spv.Variable init(%0) : !spv.ptr, Function> diff --git a/mlir/test/Dialect/Vector/canonicalize.mlir b/mlir/test/Dialect/Vector/canonicalize.mlir --- a/mlir/test/Dialect/Vector/canonicalize.mlir +++ b/mlir/test/Dialect/Vector/canonicalize.mlir @@ -234,10 +234,10 @@ // CHECK: [[T0:%.*]] = vector.transpose [[ARG]], [2, 1, 0] %0 = vector.transpose %arg, [1, 2, 0] : vector<4x3x2xf32> to vector<3x2x4xf32> %1 = vector.transpose %0, [1, 0, 2] : vector<3x2x4xf32> to vector<2x3x4xf32> - // CHECK-NOT: transpose + // CHECK: [[T1:%.*]] = vector.transpose %arg0, [2, 1, 0] %2 = vector.transpose %1, [2, 1, 0] : vector<2x3x4xf32> to vector<4x3x2xf32> %3 = vector.transpose %2, [2, 1, 0] : vector<4x3x2xf32> to vector<2x3x4xf32> - // CHECK: [[MUL:%.*]] = mulf [[T0]], [[T0]] + // CHECK: [[MUL:%.*]] = mulf [[T0]], [[T1]] %4 = mulf %1, %3 : vector<2x3x4xf32> // CHECK: [[T5:%.*]] = vector.transpose [[MUL]], [2, 1, 0] %5 = vector.transpose %4, [2, 1, 0] : vector<2x3x4xf32> to vector<4x3x2xf32> diff --git a/mlir/test/Transforms/canonicalize.mlir b/mlir/test/Transforms/canonicalize.mlir --- a/mlir/test/Transforms/canonicalize.mlir +++ b/mlir/test/Transforms/canonicalize.mlir @@ -662,7 +662,7 @@ // // CHECK-LABEL: func @lowered_affine_ceildiv func @lowered_affine_ceildiv() -> (index, index) { -// CHECK-NEXT: %c-1 = constant -1 : index +// CHECK-DAG: %c-1 = constant -1 : index %c-43 = constant -43 : index %c42 = constant 42 : index %c0 = constant 0 : index @@ -675,7 +675,7 @@ %5 = subi %c0, %4 : index %6 = addi %4, %c1 : index %7 = select %0, %5, %6 : index -// CHECK-NEXT: %c2 = constant 2 : index +// CHECK-DAG: %c2 = constant 2 : index %c43 = constant 43 : index %c42_0 = constant 42 : index %c0_1 = constant 0 : index @@ -688,6 +688,8 @@ %13 = subi %c0_1, %12 : index %14 = addi %12, %c1_2 : index %15 = select %8, %13, %14 : index + + // CHECK-NEXT: return %c-1, %c2 return %7, %15 : index, index } diff --git a/mlir/test/Transforms/scf-loop-unroll.mlir b/mlir/test/Transforms/scf-loop-unroll.mlir --- a/mlir/test/Transforms/scf-loop-unroll.mlir +++ b/mlir/test/Transforms/scf-loop-unroll.mlir @@ -31,9 +31,9 @@ scf.yield %sum0, %sum1 : f32, f32 } return %sum#0, %sum#1 : f32, f32 - // CHECK: %[[C0:.*]] = constant 0 : index - // CHECK-NEXT: %[[C1:.*]] = constant 1 : index - // CHECK-NEXT: %[[C3:.*]] = constant 3 : index + // CHECK-DAG: %[[C0:.*]] = constant 0 : index + // CHECK-DAG: %[[C1:.*]] = constant 1 : index + // CHECK-DAG: %[[C3:.*]] = constant 3 : index // CHECK-NEXT: %[[REM:.*]] = remi_signed %[[N]], %[[C3]] // CHECK-NEXT: %[[UB:.*]] = subi %[[N]], %[[REM]] // CHECK-NEXT: %[[SUM:.*]]:2 = scf.for {{.*}} = %[[C0]] to %[[UB]] step %[[C3]] iter_args diff --git a/mlir/test/Transforms/test-canonicalize.mlir b/mlir/test/Transforms/test-canonicalize.mlir --- a/mlir/test/Transforms/test-canonicalize.mlir +++ b/mlir/test/Transforms/test-canonicalize.mlir @@ -39,9 +39,9 @@ // CHECK-LABEL: func @test_commutative_multi // CHECK-SAME: (%[[ARG_0:[a-z0-9]*]]: i32, %[[ARG_1:[a-z0-9]*]]: i32) func @test_commutative_multi(%arg0: i32, %arg1: i32) -> (i32, i32) { - // CHECK: %[[C42:.*]] = constant 42 : i32 + // CHECK-DAG: %[[C42:.*]] = constant 42 : i32 %c42_i32 = constant 42 : i32 - // CHECK: %[[C43:.*]] = constant 43 : i32 + // CHECK-DAG: %[[C43:.*]] = constant 43 : i32 %c43_i32 = constant 43 : i32 // CHECK-NEXT: %[[O0:.*]] = "test.op_commutative"(%[[ARG_0]], %[[ARG_1]], %[[C42]], %[[C43]]) : (i32, i32, i32, i32) -> i32 %y = "test.op_commutative"(%c42_i32, %arg0, %arg1, %c43_i32) : (i32, i32, i32, i32) -> i32