Skip to content

Commit 8cf2077

Browse files
authored
Integrate with llvm-project at a807bbea6f48b368388cd796782724e3a53f58a0 (#19321)
Still carrying a revert for 1004865f1ca41a9581da8747f34b29862d3ebc3d and a cherry pick for llvm/llvm-project#116650. This time, we have some changes related to tablegen renaming in the vector dialect and op syntax changes in the bufferization dialect.
1 parent ee3797d commit 8cf2077

File tree

16 files changed

+30
-29
lines changed

16 files changed

+30
-29
lines changed

compiler/src/iree/compiler/Codegen/Common/test/bufferize_copy_only_dispatches.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func.func @concatenate_cst() {
8888

8989
// CHECK-LABEL: func.func @concatenate_cst()
9090
// CHECK-DAG: %[[CST:.+]] = arith.constant dense<0> : tensor<2x3xi32>
91-
// CHECK-DAG: %[[ZERO:.+]] = bufferization.to_memref %[[CST]] : memref<2x3xi32
91+
// CHECK-DAG: %[[ZERO:.+]] = bufferization.to_memref %[[CST]] : tensor<2x3xi32> to memref<2x3xi32
9292
// CHECK-DAG: %[[DEST_BINDING:.+]] = hal.interface.binding.subspan
9393
// CHECK-DAG: %[[SUBVIEW:.+]] = memref.subview %[[DEST_BINDING]][0, 2] [2, 3]
9494
// CHECK: linalg.generic

compiler/src/iree/compiler/Codegen/Common/test/fold_tensor_extract_op.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ func.func @fold_tensor_extract(%arg0 : memref<2x3xi32>) -> i32
44
{
55
%c1 = arith.constant 1 : index
66
%c2 = arith.constant 2 : index
7-
%0 = bufferization.to_tensor %arg0 : memref<2x3xi32>
7+
%0 = bufferization.to_tensor %arg0 : memref<2x3xi32> to tensor<2x3xi32>
88
%1 = tensor.extract %0[%c1, %c2] : tensor<2x3xi32>
99
return %1 : i32
1010
}

compiler/src/iree/compiler/Codegen/Common/test/iree_comprehensive_bufferize.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func.func @early_bufferized_copy_cst_ops() {
272272
%c1 = arith.constant 1 : index
273273
%c2 = arith.constant 2 : index
274274
%cst = arith.constant dense<0> : tensor<2x3xi32>
275-
%0 = bufferization.to_memref %cst : memref<2x3xi32, affine_map<(d0, d1)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2)>>
275+
%0 = bufferization.to_memref %cst : tensor<2x3xi32> to memref<2x3xi32, affine_map<(d0, d1)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2)>>
276276
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c0) : memref<2x5xi32>
277277
memref.assume_alignment %1, 64 : memref<2x5xi32>
278278
%2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c0) : !flow.dispatch.tensor<readwrite:tensor<2x5xi32>>
@@ -1402,7 +1402,7 @@ func.func @bufferize_cst_output_tensor() {
14021402

14031403
// CHECK-DAG: %[[CST1:.+]] = arith.constant -2147483648 : i32
14041404
// CHECK-DAG: %[[CST5:.+]] = arith.constant dense<[1, 2, 3, 4, 5]> : tensor<5xi32>
1405-
// CHECK: %[[CAST5:.+]] = bufferization.to_memref %[[CST5]] : memref<5xi32>
1405+
// CHECK: %[[CAST5:.+]] = bufferization.to_memref %[[CST5]] : tensor<5xi32> to memref<5xi32>
14061406
// CHECK: %[[INPUT:.+]] = hal.interface.binding.subspan layout({{.+}}) binding(0) : memref<5xf32, #hal.descriptor_type<storage_buffer>>
14071407
// CHECK: %[[OUTPUT:.+]] = hal.interface.binding.subspan layout({{.+}}) binding(1) : memref<i32, #hal.descriptor_type<storage_buffer>>
14081408
// CHECK: linalg.fill ins(%[[CST1]] : i32) outs(%[[OUTPUT]] : memref<i32{{.+}}>)

compiler/src/iree/compiler/Codegen/Common/test/tile_and_distribute_to_workgroups.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,8 @@ hal.executable private @static_3d_fft_stage3 {
743743
%c3 = arith.constant 3 : index
744744
%cst = arith.constant dense<[1.000000e+00, 0.707106769, 6.12323426E-17, -0.707106769]> : tensor<4xf32>
745745
%cst_0 = arith.constant dense<[-0.000000e+00, -0.707106769, -1.000000e+00, -0.707106769]> : tensor<4xf32>
746-
%0 = bufferization.to_memref %cst_0 : memref<4xf32>
747-
%1 = bufferization.to_memref %cst : memref<4xf32>
746+
%0 = bufferization.to_memref %cst_0 : tensor<4xf32> to memref<4xf32>
747+
%1 = bufferization.to_memref %cst : tensor<4xf32> to memref<4xf32>
748748
%2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) : memref<64x128x32xf32>
749749
%3 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) : memref<64x128x32xf32>
750750
iree_linalg_ext.fft {lowering_config = #config}

compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUDialect.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def IREEGPU_Dialect : Dialect {
4141

4242
class RankedTensorOrVectorOf<list<Type> allowedTypes> :
4343
ShapedContainerType<allowedTypes,
44-
Or<[IsVectorTypePred, And<[IsTensorTypePred, HasRankPred]>]>,
44+
Or<[IsVectorOfNonZeroRankTypePred, And<[IsTensorTypePred, HasRankPred]>]>,
4545
"ranked tensor or vector", "::mlir::ShapedType">;
4646

4747
def AnyRankedTensorOrVector : RankedTensorOrVectorOf<[AnyType]>;

compiler/src/iree/compiler/Codegen/LLVMCPU/test/select_x86_64_lowering_strategy.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ func.func @static_3d_fft_stage3() attributes {hal.executable.target = #executabl
366366
%c3 = arith.constant 3 : index
367367
%cst = arith.constant dense<[1.000000e+00, 0.707106769, 6.12323426E-17, -0.707106769]> : tensor<4xf32>
368368
%cst_0 = arith.constant dense<[-0.000000e+00, -0.707106769, -1.000000e+00, -0.707106769]> : tensor<4xf32>
369-
%0 = bufferization.to_memref %cst_0 : memref<4xf32>
370-
%1 = bufferization.to_memref %cst : memref<4xf32>
369+
%0 = bufferization.to_memref %cst_0 : tensor<4xf32> to memref<4xf32>
370+
%1 = bufferization.to_memref %cst : tensor<4xf32> to memref<4xf32>
371371
%2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) : memref<64x128x32xf32>
372372
%3 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) : memref<64x128x32xf32>
373373
iree_linalg_ext.fft ins(%c3, %1, %0 : index, memref<4xf32>, memref<4xf32>) outs(%2, %3 : memref<64x128x32xf32>, memref<64x128x32xf32>)

compiler/src/iree/compiler/Codegen/LLVMGPU/test/gpu_set_num_workgroups.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ func.func @static_3d_fft_stage3() {
231231
%c32 = arith.constant 32 : index
232232
%cst = arith.constant dense<[1.000000e+00, 0.707106769, 6.12323426E-17, -0.707106769]> : tensor<4xf32>
233233
%cst_0 = arith.constant dense<[-0.000000e+00, -0.707106769, -1.000000e+00, -0.707106769]> : tensor<4xf32>
234-
%0 = bufferization.to_memref %cst_0 : memref<4xf32>
235-
%1 = bufferization.to_memref %cst : memref<4xf32>
234+
%0 = bufferization.to_memref %cst_0 : tensor<4xf32> to memref<4xf32>
235+
%1 = bufferization.to_memref %cst : tensor<4xf32> to memref<4xf32>
236236
%2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) : memref<64x128x32xf32>
237237
%3 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) : memref<64x128x32xf32>
238238
iree_linalg_ext.fft {__internal_linalg_transform__ = "workgroup"} ins(%c3, %1, %0 : index, memref<4xf32>, memref<4xf32>) outs(%2, %3 : memref<64x128x32xf32>, memref<64x128x32xf32>)

compiler/src/iree/compiler/Codegen/SPIRV/test/config_default_linalg_ext_ops.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ func.func @static_3d_fft_stage3() {
9999
%c32 = arith.constant 32 : index
100100
%cst = arith.constant dense<[1.000000e+00, 0.707106769, 6.12323426E-17, -0.707106769]> : tensor<4xf32>
101101
%cst_0 = arith.constant dense<[-0.000000e+00, -0.707106769, -1.000000e+00, -0.707106769]> : tensor<4xf32>
102-
%0 = bufferization.to_memref %cst_0 : memref<4xf32>
103-
%1 = bufferization.to_memref %cst : memref<4xf32>
102+
%0 = bufferization.to_memref %cst_0 : tensor<4xf32> to memref<4xf32>
103+
%1 = bufferization.to_memref %cst : tensor<4xf32> to memref<4xf32>
104104
%2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) : memref<64x128x32xf32>
105105
%3 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) : memref<64x128x32xf32>
106106
iree_linalg_ext.fft ins(%c3, %1, %0 : index, memref<4xf32>, memref<4xf32>) outs(%2, %3 : memref<64x128x32xf32>, memref<64x128x32xf32>)

compiler/src/iree/compiler/Codegen/SPIRV/test/tile_and_promote_cooperative_matrix.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ func.func @matmul_f16_128x262144x2304() attributes {translation_info = #translat
616616
%c134217728 = arith.constant 134217728 : index
617617
%cst = arith.constant 0.000000e+00 : f16
618618
%cst_0 = arith.constant dense<"0x69222B2E40A3002A45AC1AAB2E2E202DA21C212680264C2A102314A041A7D029CB28352E5BAAD3B02F299D9A142B8AA1D1285C28412B25AF9A24EE2BA22C242D53AD9E2948A9289FCF301D28012F08AD68A6DD20ECAC912465290B2E9420C5AA50A222A912AB9526B62ADA2039AD4D912C9FDD287B20B224D329BA2A4D2C41A76DAB7E30B027F62ED1A0F1273A2BAE9D0FA48029812992A65AA92A2C9C2EE9A744A4632C5FA8A9A4CF2D70A482A0F5A2DBA7B6304B9D22A52B1B9DA8E424722AB5ACD0248A2B8B29C82D782E402D1A99F0A60CA4DE2DD32815266F2A6B247FA6FE214E2853AA402390AB6925F1A339307F2664A23CACBE28BA2B3D286DB0BA2E"> : tensor<128xf16>
619-
%0 = bufferization.to_memref %cst_0 : memref<128xf16>
619+
%0 = bufferization.to_memref %cst_0 : tensor<128xf16> to memref<128xf16>
620620
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c96565312) : memref<128x2304xf16>
621621
%2 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c806357120) : memref<2304x262144xf16>
622622
%3 = hal.interface.binding.subspan layout(#pipeline_layout) binding(2) alignment(64) offset(%c134217728) : memref<128x262144xf16>

compiler/src/iree/compiler/Dialect/Flow/IR/FlowOps.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ def FLOW_TensorLoadOp : FLOW_PureOp<"tensor.load", [
12691269
Variadic<FLOW_Dim>:$indices
12701270
);
12711271
let results = (outs
1272-
AnyTypeOf<[FLOW_PrimitiveType, AnyVector]>:$result
1272+
AnyTypeOf<[FLOW_PrimitiveType, AnyVectorOfNonZeroRank]>:$result
12731273
);
12741274

12751275
let assemblyFormat = [{
@@ -1315,7 +1315,7 @@ def FLOW_TensorStoreOp : FLOW_PureOp<"tensor.store", [
13151315
}];
13161316

13171317
let arguments = (ins
1318-
AnyTypeOf<[FLOW_PrimitiveType, AnyVector]>:$value,
1318+
AnyTypeOf<[FLOW_PrimitiveType, AnyVectorOfNonZeroRank]>:$value,
13191319
FLOW_Tensor:$target,
13201320
FLOW_ShapeDynamicDims:$target_dims,
13211321
Variadic<FLOW_Dim>:$indices

0 commit comments

Comments
 (0)