Skip to content

Commit

Permalink
[AutoBump] Merge with fixes of 13d983e (Jun 17)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgehre-amd committed Sep 12, 2024
2 parents 75073a8 + 13d983e commit 41f4ee0
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 116 deletions.
8 changes: 1 addition & 7 deletions mlir/lib/Transforms/Utils/DialectConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2857,13 +2857,7 @@ static LogicalResult legalizeUnresolvedMaterialization(

// Try to materialize the conversion.
if (const TypeConverter *converter = mat.getConverter()) {
// FIXME: Determine a suitable insertion location when there are multiple
// inputs.
if (inputOperands.size() == 1)
rewriter.setInsertionPointAfterValue(inputOperands.front());
else
rewriter.setInsertionPoint(op);

rewriter.setInsertionPoint(op);
Value newMaterialization;
switch (mat.getMaterializationKind()) {
case MaterializationKind::Argument:
Expand Down
15 changes: 9 additions & 6 deletions mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,10 @@ func.func @mului_extended_vector1d(%arg0: vector<3xi64>, %arg1: vector<3xi64>) -
// -----

// CHECK-LABEL: func @cmpf_2dvector(
// CHECK-SAME: %[[OARG0:.*]]: vector<4x3xf32>, %[[OARG1:.*]]: vector<4x3xf32>)
func.func @cmpf_2dvector(%arg0 : vector<4x3xf32>, %arg1 : vector<4x3xf32>) {
// CHECK: %[[ARG0:.*]] = builtin.unrealized_conversion_cast
// CHECK: %[[ARG1:.*]] = builtin.unrealized_conversion_cast
// CHECK-DAG: %[[ARG0:.*]] = builtin.unrealized_conversion_cast %[[OARG0]]
// CHECK-DAG: %[[ARG1:.*]] = builtin.unrealized_conversion_cast %[[OARG1]]
// CHECK: %[[EXTRACT1:.*]] = llvm.extractvalue %[[ARG0]][0] : !llvm.array<4 x vector<3xf32>>
// CHECK: %[[EXTRACT2:.*]] = llvm.extractvalue %[[ARG1]][0] : !llvm.array<4 x vector<3xf32>>
// CHECK: %[[CMP:.*]] = llvm.fcmp "olt" %[[EXTRACT1]], %[[EXTRACT2]] : vector<3xf32>
Expand All @@ -492,9 +493,10 @@ func.func @cmpf_2dvector(%arg0 : vector<4x3xf32>, %arg1 : vector<4x3xf32>) {
// -----

// CHECK-LABEL: func @cmpi_0dvector(
// CHECK-SAME: %[[OARG0:.*]]: vector<i32>, %[[OARG1:.*]]: vector<i32>)
func.func @cmpi_0dvector(%arg0 : vector<i32>, %arg1 : vector<i32>) {
// CHECK: %[[ARG0:.*]] = builtin.unrealized_conversion_cast
// CHECK: %[[ARG1:.*]] = builtin.unrealized_conversion_cast
// CHECK-DAG: %[[ARG0:.*]] = builtin.unrealized_conversion_cast %[[OARG0]]
// CHECK-DAG: %[[ARG1:.*]] = builtin.unrealized_conversion_cast %[[OARG1]]
// CHECK: %[[CMP:.*]] = llvm.icmp "ult" %[[ARG0]], %[[ARG1]] : vector<1xi32>
%0 = arith.cmpi ult, %arg0, %arg1 : vector<i32>
func.return
Expand All @@ -503,9 +505,10 @@ func.func @cmpi_0dvector(%arg0 : vector<i32>, %arg1 : vector<i32>) {
// -----

// CHECK-LABEL: func @cmpi_2dvector(
// CHECK-SAME: %[[OARG0:.*]]: vector<4x3xi32>, %[[OARG1:.*]]: vector<4x3xi32>)
func.func @cmpi_2dvector(%arg0 : vector<4x3xi32>, %arg1 : vector<4x3xi32>) {
// CHECK: %[[ARG0:.*]] = builtin.unrealized_conversion_cast
// CHECK: %[[ARG1:.*]] = builtin.unrealized_conversion_cast
// CHECK-DAG: %[[ARG0:.*]] = builtin.unrealized_conversion_cast %[[OARG0]]
// CHECK-DAG: %[[ARG1:.*]] = builtin.unrealized_conversion_cast %[[OARG1]]
// CHECK: %[[EXTRACT1:.*]] = llvm.extractvalue %[[ARG0]][0] : !llvm.array<4 x vector<3xi32>>
// CHECK: %[[EXTRACT2:.*]] = llvm.extractvalue %[[ARG1]][0] : !llvm.array<4 x vector<3xi32>>
// CHECK: %[[CMP:.*]] = llvm.icmp "ult" %[[EXTRACT1]], %[[EXTRACT2]] : vector<3xi32>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ func.func @bitcast_2d(%arg0: vector<2x4xf32>) {

// CHECK-LABEL: func @select_2d(
func.func @select_2d(%arg0 : vector<4x3xi1>, %arg1 : vector<4x3xi32>, %arg2 : vector<4x3xi32>) {
// CHECK: %[[ARG0:.*]] = builtin.unrealized_conversion_cast %arg0
// CHECK: %[[ARG1:.*]] = builtin.unrealized_conversion_cast %arg1
// CHECK: %[[ARG2:.*]] = builtin.unrealized_conversion_cast %arg2
// CHECK-DAG: %[[ARG0:.*]] = builtin.unrealized_conversion_cast %arg0
// CHECK-DAG: %[[ARG1:.*]] = builtin.unrealized_conversion_cast %arg1
// CHECK-DAG: %[[ARG2:.*]] = builtin.unrealized_conversion_cast %arg2
// CHECK: %[[EXTRACT1:.*]] = llvm.extractvalue %[[ARG0]][0] : !llvm.array<4 x vector<3xi1>>
// CHECK: %[[EXTRACT2:.*]] = llvm.extractvalue %[[ARG1]][0] : !llvm.array<4 x vector<3xi32>>
// CHECK: %[[EXTRACT3:.*]] = llvm.extractvalue %[[ARG2]][0] : !llvm.array<4 x vector<3xi32>>
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Conversion/ArithToSPIRV/arith-to-spirv.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func.func @index_scalar(%lhs: index, %rhs: index) {
// CHECK-LABEL: @index_scalar_srem
// CHECK-SAME: (%[[A:.+]]: index, %[[B:.+]]: index)
func.func @index_scalar_srem(%lhs: index, %rhs: index) {
// CHECK: %[[LHS:.+]] = builtin.unrealized_conversion_cast %[[A]] : index to i32
// CHECK: %[[RHS:.+]] = builtin.unrealized_conversion_cast %[[B]] : index to i32
// CHECK-DAG: %[[LHS:.+]] = builtin.unrealized_conversion_cast %[[A]] : index to i32
// CHECK-DAG: %[[RHS:.+]] = builtin.unrealized_conversion_cast %[[B]] : index to i32
// CHECK: %[[LABS:.+]] = spirv.GL.SAbs %[[LHS]] : i32
// CHECK: %[[RABS:.+]] = spirv.GL.SAbs %[[RHS]] : i32
// CHECK: %[[ABS:.+]] = spirv.UMod %[[LABS]], %[[RABS]] : i32
Expand Down
18 changes: 9 additions & 9 deletions mlir/test/Conversion/IndexToLLVM/index-to-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func.func @trivial_ops(%a: index, %b: index) {
// CHECK-LABEL: @ceildivs
// CHECK-SAME: %[[NI:.*]]: index, %[[MI:.*]]: index
func.func @ceildivs(%n: index, %m: index) -> index {
// CHECK: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK-DAG: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK-DAG: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 :
// CHECK: %[[POS_ONE:.*]] = llvm.mlir.constant(1 :
// CHECK: %[[NEG_ONE:.*]] = llvm.mlir.constant(-1 :
Expand Down Expand Up @@ -82,8 +82,8 @@ func.func @ceildivs(%n: index, %m: index) -> index {
// CHECK-LABEL: @ceildivu
// CHECK-SAME: %[[NI:.*]]: index, %[[MI:.*]]: index
func.func @ceildivu(%n: index, %m: index) -> index {
// CHECK: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK-DAG: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK-DAG: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 :
// CHECK: %[[ONE:.*]] = llvm.mlir.constant(1 :

Expand All @@ -103,11 +103,11 @@ func.func @ceildivu(%n: index, %m: index) -> index {
// CHECK-LABEL: @floordivs
// CHECK-SAME: %[[NI:.*]]: index, %[[MI:.*]]: index
func.func @floordivs(%n: index, %m: index) -> index {
// CHECK: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK: %[[ZERO:.*]] = llvm.mlir.constant(0 :
// CHECK: %[[POS_ONE:.*]] = llvm.mlir.constant(1 :
// CHECK: %[[NEG_ONE:.*]] = llvm.mlir.constant(-1 :
// CHECK-DAG: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK-DAG: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK-DAG: %[[ZERO:.*]] = llvm.mlir.constant(0 :
// CHECK-DAG: %[[POS_ONE:.*]] = llvm.mlir.constant(1 :
// CHECK-DAG: %[[NEG_ONE:.*]] = llvm.mlir.constant(-1 :

// CHECK: %[[M_NEG:.*]] = llvm.icmp "slt" %[[M]], %[[ZERO]]
// CHECK: %[[X:.*]] = llvm.select %[[M_NEG]], %[[POS_ONE]], %[[NEG_ONE]]
Expand Down
12 changes: 6 additions & 6 deletions mlir/test/Conversion/IndexToSPIRV/index-to-spirv.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func.func @constant_ops() {
// CHECK-LABEL: @ceildivs
// CHECK-SAME: %[[NI:.*]]: index, %[[MI:.*]]: index
func.func @ceildivs(%n: index, %m: index) -> index {
// CHECK: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK-DAG: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK-DAG: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK: %[[ZERO:.*]] = spirv.Constant 0
// CHECK: %[[POS_ONE:.*]] = spirv.Constant 1
// CHECK: %[[NEG_ONE:.*]] = spirv.Constant -1
Expand Down Expand Up @@ -99,8 +99,8 @@ func.func @ceildivs(%n: index, %m: index) -> index {
// CHECK-LABEL: @ceildivu
// CHECK-SAME: %[[NI:.*]]: index, %[[MI:.*]]: index
func.func @ceildivu(%n: index, %m: index) -> index {
// CHECK: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK-DAG: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK-DAG: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK: %[[ZERO:.*]] = spirv.Constant 0
// CHECK: %[[ONE:.*]] = spirv.Constant 1

Expand All @@ -120,8 +120,8 @@ func.func @ceildivu(%n: index, %m: index) -> index {
// CHECK-LABEL: @floordivs
// CHECK-SAME: %[[NI:.*]]: index, %[[MI:.*]]: index
func.func @floordivs(%n: index, %m: index) -> index {
// CHECK: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK-DAG: %[[N:.*]] = builtin.unrealized_conversion_cast %[[NI]]
// CHECK-DAG: %[[M:.*]] = builtin.unrealized_conversion_cast %[[MI]]
// CHECK: %[[ZERO:.*]] = spirv.Constant 0
// CHECK: %[[POS_ONE:.*]] = spirv.Constant 1
// CHECK: %[[NEG_ONE:.*]] = spirv.Constant -1
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Conversion/MathToSPIRV/math-to-core-spirv.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func.func @copy_sign_vector_0D(%value: vector<1xf16>, %sign: vector<1xf16>) -> v

// CHECK-LABEL: func @copy_sign_vector_0D
// CHECK-SAME: (%[[VALUE:.+]]: vector<1xf16>, %[[SIGN:.+]]: vector<1xf16>)
// CHECK: %[[CASTVAL:.+]] = builtin.unrealized_conversion_cast %[[VALUE]] : vector<1xf16> to f16
// CHECK: %[[CASTSIGN:.+]] = builtin.unrealized_conversion_cast %[[SIGN]] : vector<1xf16> to f16
// CHECK-DAG: %[[CASTVAL:.+]] = builtin.unrealized_conversion_cast %[[VALUE]] : vector<1xf16> to f16
// CHECK-DAG: %[[CASTSIGN:.+]] = builtin.unrealized_conversion_cast %[[SIGN]] : vector<1xf16> to f16
// CHECK: %[[SMASK:.+]] = spirv.Constant -32768 : i16
// CHECK: %[[VMASK:.+]] = spirv.Constant 32767 : i16
// CHECK: %[[VCAST:.+]] = spirv.Bitcast %[[CASTVAL]] : f16 to i16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,15 @@ func.func @memref_reinterpret_cast_unranked_to_dynamic_shape(%offset: index,

// -----

// CHECK-LABEL: @memref_reshape
// CHECK-LABEL: @memref_reshape(
// CHECK-SAME: %[[ARG0:.*]]: memref<2x3xf32>, %[[ARG1:.*]]: memref<?xindex>)
func.func @memref_reshape(%input : memref<2x3xf32>, %shape : memref<?xindex>) {
%output = memref.reshape %input(%shape)
: (memref<2x3xf32>, memref<?xindex>) -> memref<*xf32>
return
}
// CHECK: [[INPUT:%.*]] = builtin.unrealized_conversion_cast %{{.*}} to [[INPUT_TY:!.*]]
// CHECK: [[SHAPE:%.*]] = builtin.unrealized_conversion_cast %{{.*}} to [[SHAPE_TY:!.*]]
// CHECK-DAG: [[INPUT:%.*]] = builtin.unrealized_conversion_cast %[[ARG0]] : {{.*}} to [[INPUT_TY:!.*]]
// CHECK-DAG: [[SHAPE:%.*]] = builtin.unrealized_conversion_cast %[[ARG1]] : {{.*}} to [[SHAPE_TY:!.*]]
// CHECK: [[RANK:%.*]] = llvm.extractvalue [[SHAPE]][3, 0] : [[SHAPE_TY]]
// CHECK: [[UNRANKED_OUT_O:%.*]] = llvm.mlir.undef : !llvm.struct<(i64, ptr)>
// CHECK: [[UNRANKED_OUT_1:%.*]] = llvm.insertvalue [[RANK]], [[UNRANKED_OUT_O]][0] : !llvm.struct<(i64, ptr)>
Expand Down
24 changes: 11 additions & 13 deletions mlir/test/Conversion/MemRefToLLVM/convert-static-memref-ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ func.func @zero_d_load(%arg0: memref<f32>) -> f32 {

// -----

// CHECK-LABEL: func @static_load
// CHECK: %[[MEMREF:.*]]: memref<10x42xf32>,
// CHECK: %[[I:.*]]: index,
// CHECK: %[[J:.*]]: index)
// CHECK-LABEL: func @static_load(
// CHECK-SAME: %[[MEMREF:.*]]: memref<10x42xf32>, %[[I:.*]]: index, %[[J:.*]]: index)
func.func @static_load(%static : memref<10x42xf32>, %i : index, %j : index) {
// CHECK: %[[II:.*]] = builtin.unrealized_conversion_cast %[[I]]
// CHECK: %[[JJ:.*]] = builtin.unrealized_conversion_cast %[[J]]
// CHECK-DAG: %[[II:.*]] = builtin.unrealized_conversion_cast %[[I]]
// CHECK-DAG: %[[JJ:.*]] = builtin.unrealized_conversion_cast %[[J]]
// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
// CHECK: %[[st0:.*]] = llvm.mlir.constant(42 : index) : i64
// CHECK: %[[offI:.*]] = llvm.mul %[[II]], %[[st0]] : i64
Expand All @@ -148,8 +146,8 @@ func.func @zero_d_store(%arg0: memref<f32>, %arg1: f32) {
// CHECK: %[[MEMREF:.*]]: memref<10x42xf32>,
// CHECK-SAME: %[[I:.*]]: index, %[[J:.*]]: index,
func.func @static_store(%static : memref<10x42xf32>, %i : index, %j : index, %val : f32) {
// CHECK: %[[II:.*]] = builtin.unrealized_conversion_cast %[[I]]
// CHECK: %[[JJ:.*]] = builtin.unrealized_conversion_cast %[[J]]
// CHECK-DAG: %[[II:.*]] = builtin.unrealized_conversion_cast %[[I]]
// CHECK-DAG: %[[JJ:.*]] = builtin.unrealized_conversion_cast %[[J]]
// CHECK: %[[ptr:.*]] = llvm.extractvalue %{{.*}}[1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
// CHECK: %[[st0:.*]] = llvm.mlir.constant(42 : index) : i64
// CHECK: %[[offI:.*]] = llvm.mul %[[II]], %[[st0]] : i64
Expand Down Expand Up @@ -205,7 +203,7 @@ module attributes { dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<index, 32>> } {
func.func @address() {
%c1 = arith.constant 1 : index
%0 = memref.alloc(%c1) : memref<? x vector<2xf32>>
// CHECK: %[[CST_S:.*]] = arith.constant 1 : index
// CHECK-DAG: %[[CST_S:.*]] = arith.constant 1 : index
// CHECK: %[[CST:.*]] = builtin.unrealized_conversion_cast
// CHECK: llvm.mlir.zero
// CHECK: llvm.getelementptr %{{.*}}[[CST]]
Expand Down Expand Up @@ -269,8 +267,8 @@ func.func @memref.reshape(%arg0: memref<4x5x6xf32>) -> memref<2x6x20xf32> {
// CHECK-LABEL: func @memref.reshape.dynamic.dim
// CHECK-SAME: %[[arg:.*]]: memref<?x?x?xf32>, %[[shape:.*]]: memref<4xi64>) -> memref<?x?x12x32xf32>
func.func @memref.reshape.dynamic.dim(%arg: memref<?x?x?xf32>, %shape: memref<4xi64>) -> memref<?x?x12x32xf32> {
// CHECK: %[[arg_cast:.*]] = builtin.unrealized_conversion_cast %[[arg]] : memref<?x?x?xf32> to !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>
// CHECK: %[[shape_cast:.*]] = builtin.unrealized_conversion_cast %[[shape]] : memref<4xi64> to !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK-DAG: %[[arg_cast:.*]] = builtin.unrealized_conversion_cast %[[arg]] : memref<?x?x?xf32> to !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>
// CHECK-DAG: %[[shape_cast:.*]] = builtin.unrealized_conversion_cast %[[shape]] : memref<4xi64> to !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK: %[[undef:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>
// CHECK: %[[alloc_ptr:.*]] = llvm.extractvalue %[[arg_cast]][0] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>
// CHECK: %[[align_ptr:.*]] = llvm.extractvalue %[[arg_cast]][1] : !llvm.struct<(ptr, ptr, i64, array<3 x i64>, array<3 x i64>)>
Expand Down Expand Up @@ -318,8 +316,8 @@ func.func @memref.reshape.dynamic.dim(%arg: memref<?x?x?xf32>, %shape: memref<4x
// CHECK-LABEL: func @memref.reshape_index
// CHECK-SAME: %[[arg:.*]]: memref<?x?xi32>, %[[shape:.*]]: memref<1xindex>
func.func @memref.reshape_index(%arg0: memref<?x?xi32>, %shape: memref<1xindex>) -> memref<?xi32> {
// CHECK: %[[arg_cast:.*]] = builtin.unrealized_conversion_cast %[[arg]] : memref<?x?xi32> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
// CHECK: %[[shape_cast:.*]] = builtin.unrealized_conversion_cast %[[shape]] : memref<1xindex> to !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK-DAG: %[[arg_cast:.*]] = builtin.unrealized_conversion_cast %[[arg]] : memref<?x?xi32> to !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
// CHECK-DAG: %[[shape_cast:.*]] = builtin.unrealized_conversion_cast %[[shape]] : memref<1xindex> to !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK: %[[undef:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK: %[[alloc_ptr:.*]] = llvm.extractvalue %[[arg_cast]][0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
// CHECK: %[[align_ptr:.*]] = llvm.extractvalue %[[arg_cast]][1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
Expand Down
10 changes: 5 additions & 5 deletions mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
// CHECK-LABEL: func @view(
// CHECK: %[[ARG0F:.*]]: index, %[[ARG1F:.*]]: index, %[[ARG2F:.*]]: index
func.func @view(%arg0 : index, %arg1 : index, %arg2 : index) {
// CHECK: %[[ARG2:.*]] = builtin.unrealized_conversion_cast %[[ARG2F:.*]]
// CHECK: %[[ARG0:.*]] = builtin.unrealized_conversion_cast %[[ARG0F:.*]]
// CHECK: %[[ARG1:.*]] = builtin.unrealized_conversion_cast %[[ARG1F:.*]]
// CHECK-DAG: %[[ARG2:.*]] = builtin.unrealized_conversion_cast %[[ARG2F]]
// CHECK-DAG: %[[ARG0:.*]] = builtin.unrealized_conversion_cast %[[ARG0F]]
// CHECK-DAG: %[[ARG1:.*]] = builtin.unrealized_conversion_cast %[[ARG1F]]
// CHECK: llvm.mlir.constant(2048 : index) : i64
// CHECK: llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
%0 = memref.alloc() : memref<2048xi8>
Expand Down Expand Up @@ -408,8 +408,8 @@ func.func @atomic_rmw_with_offset(%I : memref<10xi32, strided<[1], offset: 5>>,
// CHECK-SAME: %[[ARG0:.+]]: memref<10xi32, strided<[1], offset: 5>>
// CHECK-SAME: %[[ARG1:.+]]: i32
// CHECK-SAME: %[[ARG2:.+]]: index
// CHECK: %[[MEMREF_STRUCT:.+]] = builtin.unrealized_conversion_cast %[[ARG0]] : memref<10xi32, strided<[1], offset: 5>> to !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK: %[[INDEX:.+]] = builtin.unrealized_conversion_cast %[[ARG2]] : index to i64
// CHECK-DAG: %[[MEMREF_STRUCT:.+]] = builtin.unrealized_conversion_cast %[[ARG0]] : memref<10xi32, strided<[1], offset: 5>> to !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK-DAG: %[[INDEX:.+]] = builtin.unrealized_conversion_cast %[[ARG2]] : index to i64
// CHECK: %[[BASE_PTR:.+]] = llvm.extractvalue %[[MEMREF_STRUCT]][1] : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
// CHECK: %[[OFFSET:.+]] = llvm.mlir.constant(5 : index) : i64
// CHECK: %[[OFFSET_PTR:.+]] = llvm.getelementptr %[[BASE_PTR]][%[[OFFSET]]] : (!llvm.ptr, i64) -> !llvm.ptr, i32
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Conversion/MemRefToSPIRV/bitwidth-emulation.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ func.func @load_i4(%arg0: memref<?xi4, #spirv.storage_class<StorageBuffer>>, %i:

// CHECK-LABEL: @store_i4
func.func @store_i4(%arg0: memref<?xi4, #spirv.storage_class<StorageBuffer>>, %value: i4, %i: index) {
// CHECK: %[[VAL:.+]] = builtin.unrealized_conversion_cast %{{.+}} : i4 to i32
// CHECK: %[[INDEX:.+]] = builtin.unrealized_conversion_cast %{{.+}} : index to i32
// CHECK-DAG: %[[VAL:.+]] = builtin.unrealized_conversion_cast %{{.+}} : i4 to i32
// CHECK-DAG: %[[INDEX:.+]] = builtin.unrealized_conversion_cast %{{.+}} : index to i32
// CHECK: %[[ZERO:.+]] = spirv.Constant 0 : i32
// CHECK: %[[EIGHT:.+]] = spirv.Constant 8 : i32
// CHECK: %[[FOUR:.+]] = spirv.Constant 4 : i32
Expand Down
Loading

0 comments on commit 41f4ee0

Please sign in to comment.