forked from OSchip/llvm-project
[Canonicalize] Switch the default setting to "top down".
This provides a sizable compile time improvement by seeding the worklist in an order that leads to less iterations of the worklist. This patch only changes the behavior of the Canonicalize pass itself, it does not affect other passes that use the GreedyPatternRewrite driver Differential Revision: https://reviews.llvm.org/D103053
This commit is contained in:
parent
bc56620b8b
commit
a004da0d77
|
@ -364,7 +364,7 @@ def Canonicalizer : Pass<"canonicalize"> {
|
|||
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",
|
||||
|
|
|
@ -52,10 +52,10 @@ func @expm1_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector
|
|||
// 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>
|
||||
|
|
|
@ -204,7 +204,7 @@ func @compose_affine_maps_diamond_dependency(%arg0: f32, %arg1: memref<4x4xf32>)
|
|||
|
||||
// -----
|
||||
|
||||
// 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 @@ func @symbolic_composition_c(%arg0: index, %arg1: index, %arg2: index, %arg3: in
|
|||
|
||||
// -----
|
||||
|
||||
// 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 @@ func @symbolic_composition_d(%arg0: index, %arg1: index, %arg2: index, %arg3: in
|
|||
%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 @@ func @deduplicate_affine_max_expressions(%i0: index, %i1: index) -> index {
|
|||
// -----
|
||||
|
||||
// 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 @@ func @merge_affine_min_ops(%i0: index, %i1: index, %i2: index, %i3: index) -> (i
|
|||
|
||||
// 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 @@ func @dont_merge_affine_min_if_not_single_dim(%i0: index, %i1: index, %i2: index
|
|||
return %1: index
|
||||
}
|
||||
|
||||
|
||||
// -----
|
||||
|
||||
// CHECK-LABEL: func @dont_merge_affine_min_if_not_single_sym
|
||||
|
@ -802,7 +801,7 @@ func @dont_merge_affine_min_if_not_single_sym(%i0: index, %i1: index, %i2: index
|
|||
// -----
|
||||
|
||||
// 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 @@ func @merge_affine_max_ops(%i0: index, %i1: index, %i2: index, %i3: index) -> (i
|
|||
|
||||
// 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
|
||||
|
|
|
@ -98,8 +98,8 @@ func @multiple_results(%arg0: tensor<4xf32>) -> (tensor<4xf32>, tensor<4xf32>) {
|
|||
|
||||
// CHECK-LABEL: func @dynamic_results(
|
||||
// CHECK-SAME: %[[ARG:.*]]: tensor<?x?xf32>
|
||||
// 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<?x?xf32>
|
||||
// CHECK: %[[DIM0:.*]] = memref.dim %[[ARG]], %[[C0]] : tensor<?x?xf32>
|
||||
// CHECK: %[[DIM1:.*]] = memref.dim %[[ARG]], %[[C1]] : tensor<?x?xf32>
|
||||
|
@ -206,8 +206,8 @@ func @bufferize_subtensor_insert(%t : tensor<?x?xf32>, %st0 : tensor<2x3xf32>, %
|
|||
(tensor<?x?xf32>, tensor<?x?xf32>) {
|
||||
%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
|
||||
|
||||
|
|
|
@ -1027,9 +1027,9 @@ func @fold_tiled_loop_results(%A: memref<48xf32>, %B: tensor<48xf32>,
|
|||
// 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]])
|
||||
|
|
|
@ -98,11 +98,11 @@ module {
|
|||
// TLOOP-SAME: %[[C:[a-zA-Z0-9_]+]]: tensor<?x?xf32>,
|
||||
// TLOOP-SAME: %[[ABC_INIT:[a-zA-Z0-9_]+]]: tensor<?x?xf32>) -> tensor<?x?xf32> {
|
||||
|
||||
// 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 @@ module {
|
|||
// TLOOP-SAME: %[[B:[a-zA-Z0-9_]+]]: tensor<?x?xf32>,
|
||||
// TLOOP-SAME: %[[AB:[a-zA-Z0-9_]+]]: tensor<?x?xf32>
|
||||
|
||||
// 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]]
|
||||
|
|
|
@ -122,9 +122,9 @@ func @nested_parallel(%0: memref<?x?x?xf64>) -> memref<?x?x?xf64> {
|
|||
}
|
||||
|
||||
// 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 @@ func @one_unused(%cond: i1) -> (index) {
|
|||
}
|
||||
|
||||
// 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 @@ func @nested_unused(%cond1: i1, %cond2: i1) -> (index) {
|
|||
}
|
||||
|
||||
// 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 @@ func @to_select1(%cond: i1) -> index {
|
|||
}
|
||||
|
||||
// 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 @@ func @to_select_same_val(%cond: i1) -> (index, index) {
|
|||
}
|
||||
|
||||
// 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 @@ func @to_select2(%cond: i1) -> (index, index) {
|
|||
}
|
||||
|
||||
// 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
|
||||
|
|
|
@ -486,9 +486,9 @@ func @convert_logical_or_true_false_vector(%arg: vector<3xi1>) -> (vector<3xi1>,
|
|||
|
||||
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<i32, Function>
|
||||
%3 = spv.Variable init(%0) : !spv.ptr<i32, Function>
|
||||
|
@ -517,9 +517,9 @@ func @canonicalize_selection_op_scalar_type(%cond: i1) -> () {
|
|||
|
||||
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<vector<3xi32>, Function>
|
||||
%3 = spv.Variable init(%0) : !spv.ptr<vector<3xi32>, Function>
|
||||
|
@ -590,9 +590,9 @@ func @cannot_canonicalize_selection_op_0(%cond: i1) -> () {
|
|||
// 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<vector<3xi32>, Function>
|
||||
%3 = spv.Variable init(%0) : !spv.ptr<vector<3xi32>, Function>
|
||||
|
@ -628,9 +628,9 @@ func @cannot_canonicalize_selection_op_1(%cond: i1) -> () {
|
|||
// 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<vector<3xi32>, Function>
|
||||
%3 = spv.Variable init(%0) : !spv.ptr<vector<3xi32>, Function>
|
||||
|
@ -663,8 +663,8 @@ func @cannot_canonicalize_selection_op_2(%cond: i1) -> () {
|
|||
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<vector<3xi32>, Function>
|
||||
%3 = spv.Variable init(%0) : !spv.ptr<vector<3xi32>, Function>
|
||||
|
@ -696,9 +696,9 @@ func @cannot_canonicalize_selection_op_3(%cond: i1) -> () {
|
|||
// 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<vector<3xi32>, Function>
|
||||
%3 = spv.Variable init(%0) : !spv.ptr<vector<3xi32>, Function>
|
||||
|
|
|
@ -234,10 +234,10 @@ func @transpose_3D_sequence(%arg : vector<4x3x2xf32>) -> vector<4x3x2xf32> {
|
|||
// 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>
|
||||
|
|
|
@ -662,7 +662,7 @@ func @lowered_affine_floordiv() -> (index, index) {
|
|||
//
|
||||
// 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 @@ func @lowered_affine_ceildiv() -> (index, index) {
|
|||
%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 @@ func @lowered_affine_ceildiv() -> (index, index) {
|
|||
%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
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ func @scf_loop_unroll_double_symbolic_ub(%arg0 : f32, %arg1 : f32, %n : index) -
|
|||
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
|
||||
|
|
|
@ -39,9 +39,9 @@ func @remove_op_with_variadic_results_and_folder(%arg0 : i32, %arg1 : i32) -> (i
|
|||
// 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
|
||||
|
|
Loading…
Reference in New Issue