Skip to content

Commit 1d97492

Browse files
nirvedhmeshramAWoloszyn
authored andcommitted
There are no llvm reverts/cherry-picks. Bump llvm to llvm/llvm-project@95d993a Bumps stablehlo to openxla/stablehlo@c27ba67 torch-mlir carries forward fixes from llvm/torch-mlir#3982 Additional forward fixes at iree-org/torch-mlir@fd34bc5 Some C++ API changes to `getStridesAndOffset` from llvm/llvm-project#123465 --------- Signed-off-by: Nirvedh Meshram <[email protected]>
1 parent d056ccc commit 1d97492

File tree

15 files changed

+35
-34
lines changed

15 files changed

+35
-34
lines changed

compiler/src/iree/compiler/Codegen/Common/FlattenMemRefSubspanPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct FlattenMemRefTypeConverter final : public TypeConverter {
9696
addConversion([](MemRefType type) -> std::optional<Type> {
9797
int64_t offset;
9898
SmallVector<int64_t> strides;
99-
if (failed(getStridesAndOffset(type, strides, offset))) {
99+
if (failed(type.getStridesAndOffset(strides, offset))) {
100100
return nullptr;
101101
}
102102
// Since the memref gets linearized, use a stride 1, offset 0.
@@ -354,7 +354,7 @@ static Value linearizeIndices(Value sourceValue, ValueRange indices,
354354
// dynamic.
355355
SmallVector<int64_t> strides;
356356
int64_t offset;
357-
if (succeeded(getStridesAndOffset(sourceType, strides, offset))) {
357+
if (succeeded(sourceType.getStridesAndOffset(strides, offset))) {
358358
// The memref itself might have an offset, but we should not account for it
359359
// when computing the linearization. The original memref might be
360360
// `memref<?x?xf32, strided<[?, ?], offset: ?>`

compiler/src/iree/compiler/Codegen/LLVMCPU/DispatchABI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ MemRefDescriptor HALDispatchABI::loadBinding(Operation *forOp, int64_t ordinal,
781781
// Construct the MemRefDescriptor type based on the information we have.
782782
// NOTE: we could use the binding length to clamp this/check that the
783783
// requested range is valid.
784-
auto [strides, offset] = getStridesAndOffset(memRefType);
784+
auto [strides, offset] = memRefType.getStridesAndOffset();
785785
if (memRefType.hasStaticShape() &&
786786
!llvm::any_of(strides, ShapedType::isDynamic) &&
787787
!ShapedType::isDynamic(offset)) {

compiler/src/iree/compiler/Codegen/LLVMGPU/ConvertToLLVM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class ConvertIREEBindingSubspanOp : public ConvertToLLVMPattern {
392392
// Add the byte offset.
393393
Value llvmBufferBasePtr = llvmBufferArg;
394394

395-
auto [strides, offset] = getStridesAndOffset(memrefType);
395+
auto [strides, offset] = memrefType.getStridesAndOffset();
396396
if (memrefType.hasStaticShape() &&
397397
!llvm::any_of(strides, ShapedType::isDynamic) &&
398398
!ShapedType::isDynamic(offset)) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ hal.executable @mma_fused_fp16 {
7171
// CHECK: llvm.br
7272
// CHECK-COUNT-2: nvvm.ldmatrix {{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(i32, i32, i32, i32)>
7373
// CHECK-COUNT-2: nvvm.mma.sync {{.*}} {layoutA = #nvvm.mma_layout<row>, layoutB = #nvvm.mma_layout<col>, shape = #nvvm.shape<m = 16, n = 8, k = 16>} : (vector<2xf16>, vector<2xf16>, vector<2xf16>) -> !llvm.struct<(vector<2xf16>, vector<2xf16>)>
74-
// CHECK-COUNT-2: llvm.inline_asm has_side_effects asm_dialect = att "cp.async.cg.shared.global [$0], [$1], $2, $3;\0A", "r,l,n,r" {{.*}}, {{.*}}, {{.*}}, {{.*}} : (!llvm.ptr<3>, !llvm.ptr<1>, i32, i32) -> ()
74+
// CHECK-COUNT-2: nvvm.cp.async.shared.global %{{.*}}, %{{.*}}, 16, cache = cg, %{{.*}} : !llvm.ptr<3>, !llvm.ptr<1>, i32
7575
// CHECK: nvvm.cp.async.commit.group
7676
// CHECK: nvvm.cp.async.wait.group 2
7777
// CHECK-COUNT-2: nvvm.ldmatrix {{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(i32, i32, i32, i32)>
@@ -158,7 +158,7 @@ hal.executable @mma_fused_f32 {
158158
// CHECK: nvvm.ldmatrix{{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(i32, i32, i32, i32)>
159159
// CHECK-COUNT-4: llvm.extractvalue{{.*}} : !llvm.struct<(i32, i32, i32, i32)>
160160
// CHECK-COUNT-2: nvvm.mma.sync {{.*}} {layoutA = #nvvm.mma_layout<row>, layoutB = #nvvm.mma_layout<col>, multiplicandAPtxType = #nvvm.mma_type<tf32>, multiplicandBPtxType = #nvvm.mma_type<tf32>, shape = #nvvm.shape<m = 16, n = 8, k = 8>} : (i32, i32, f32) -> !llvm.struct<(f32, f32, f32, f32)>
161-
// CHECK-COUNT-2: llvm.inline_asm has_side_effects asm_dialect = att "cp.async.cg.shared.global [$0], [$1], $2, $3;\0A", "r,l,n,r" {{.*}}, {{.*}}, {{.*}}, {{.*}} : (!llvm.ptr<3>, !llvm.ptr<1>, i32, i32) -> ()
161+
// CHECK-COUNT-2: nvvm.cp.async.shared.global %{{.*}}, %{{.*}}, 16, cache = cg, %{{.*}} : !llvm.ptr<3>, !llvm.ptr<1>, i32
162162
// CHECK: nvvm.cp.async.commit.group
163163
// CHECK: nvvm.cp.async.wait.group 2
164164
// CHECK: nvvm.ldmatrix{{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(i32, i32, i32, i32)>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ hal.executable @mma_fused {
451451
// SM80: nvvm.cp.async.wait.group 3
452452
// SM80-COUNT-4: nvvm.wmma.load{{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(i32, i32, i32, i32)
453453
// SM80-COUNT-2: nvvm.wmma.mma
454-
// SM80-COUNT-2: llvm.inline_asm has_side_effects asm_dialect = att "cp.async.cg.shared.global [$0], [$1], $2, $3;\0A", "r,l,n,r" {{.*}}, {{.*}}, {{.*}}, {{.*}} : (!llvm.ptr<3>, !llvm.ptr<1>, i32, i32) -> ()
454+
// SM80-COUNT-2: nvvm.cp.async.shared.global %{{.*}}, %{{.*}}, 16, cache = cg, %{{.*}} : !llvm.ptr<3>, !llvm.ptr<1>, i32
455455
// SM80: nvvm.cp.async.commit.group
456456
// SM80: llvm.br
457457
// SM80-NOT: nvvm.wmma.mma
@@ -529,7 +529,7 @@ hal.executable @mma_fused_fp16 {
529529
// SM80: nvvm.cp.async.wait.group 3
530530
// SM80-COUNT-2: nvvm.wmma.load{{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(vector<2xf16>, vector<2xf16>, vector<2xf16>, vector<2xf16>, vector<2xf16>, vector<2xf16>, vector<2xf16>, vector<2xf16>)
531531
// SM80-COUNT-1: nvvm.wmma.mma
532-
// SM80-COUNT-2: llvm.inline_asm has_side_effects asm_dialect = att "cp.async.cg.shared.global [$0], [$1], $2, $3;\0A", "r,l,n,r" {{.*}}, {{.*}}, {{.*}}, {{.*}} : (!llvm.ptr<3>, !llvm.ptr<1>, i32, i32) -> ()
532+
// SM80-COUNT-2: nvvm.cp.async.shared.global %{{.*}}, %{{.*}}, 16, cache = cg, %{{.*}} : !llvm.ptr<3>, !llvm.ptr<1>, i32
533533
// SM80: nvvm.cp.async.commit.group
534534
// SM80: llvm.br
535535
// SM80-NOT: nvvm.wmma.mma
@@ -602,7 +602,7 @@ hal.executable @mma_fused_fp16 {
602602
// SM80: nvvm.cp.async.wait.group 3
603603
// SM80-COUNT-4: nvvm.wmma.load{{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(i32, i32, i32, i32)
604604
// SM80-COUNT-2: nvvm.wmma.mma
605-
// SM80-COUNT-2: llvm.inline_asm has_side_effects asm_dialect = att "cp.async.cg.shared.global [$0], [$1], $2, $3;\0A", "r,l,n,r" {{.*}}, {{.*}}, {{.*}}, {{.*}} : (!llvm.ptr<3>, !llvm.ptr<1>, i32, i32) -> ()
605+
// SM80-COUNT-2: nvvm.cp.async.shared.global %{{.*}}, %{{.*}}, 16, cache = cg, %{{.*}} : !llvm.ptr<3>, !llvm.ptr<1>, i32
606606
// SM80: nvvm.cp.async.commit.group
607607
// SM80: llvm.br
608608
// SM80-NOT: nvvm.wmma.mma
@@ -670,7 +670,7 @@ hal.executable @mma_fused_fp16 {
670670
// SM80: nvvm.cp.async.wait.group 3
671671
// SM80-COUNT-4: nvvm.wmma.load{{.*}} : (!llvm.ptr<3>) -> !llvm.struct<(i32, i32, i32, i32)
672672
// SM80-COUNT-2: nvvm.wmma.mma
673-
// SM80: llvm.inline_asm has_side_effects asm_dialect = att "cp.async.cg.shared.global [$0], [$1], $2, $3;\0A", "r,l,n,r" {{.*}}, {{.*}}, {{.*}}, {{.*}} : (!llvm.ptr<3>, !llvm.ptr<1>, i32, i32) -> ()
673+
// SM80: nvvm.cp.async.shared.global %{{.*}}, %{{.*}}, 16, cache = cg, %{{.*}} : !llvm.ptr<3>, !llvm.ptr<1>, i32
674674
// SM80: nvvm.cp.async.commit.group
675675
// SM80: llvm.br
676676
// SM80-NOT: nvvm.wmma.mma

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ hal.executable @ceildiv_expand_dispatch {
183183
// CDNA3-LABEL: hal.executable public @ceildiv_expand_dispatch
184184
// CDNA3: hal.executable.variant public @rocm
185185
// CDNA3-NOT: arith.ceildivsi
186-
// CDNA3-COUNT-1: llvm.select {{.*}} : i1, i32
187-
// CDNA3-COUNT-2: llvm.sdiv {{.*}} : i32
188-
// CDNA3-COUNT-4: llvm.icmp {{.*}} : i32
189-
// CDNA3-COUNT-2: llvm.and {{.*}} : i1
190-
// CDNA3-COUNT-1: llvm.or {{.*}} : i1
191-
// CDNA3-COUNT-1: llvm.select {{.*}} : i1, i32
186+
// CDNA3-COUNT-1: llvm.select {{.*}} : vector<1xi1>, vector<1xi32>
187+
// CDNA3-COUNT-2: llvm.sdiv {{.*}} : vector<1xi32>
188+
// CDNA3-COUNT-4: llvm.icmp {{.*}} : vector<1xi32>
189+
// CDNA3-COUNT-2: llvm.and {{.*}} : vector<1xi1>
190+
// CDNA3-COUNT-1: llvm.or {{.*}} : vector<1xi1>
191+
// CDNA3-COUNT-1: llvm.select {{.*}} : vector<1xi1>, vector<1xi32>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module {
1212
// CHECK-LABEL: func.func @broadcast_read_lowering
1313
// CHECK-SAME: (%[[ARG0:.+]]: memref<4096x32xf16>)
1414
// CHECK: %[[INIT:.+]] = arith.constant dense<0.000000e+00> : vector<1x8xf16>
15-
// CHECK: %[[ELEM:.+]] = memref.load %[[ARG0]]{{.*}} : memref<4096x32xf16>
15+
// CHECK: %[[LOAD:.+]] = vector.load %[[ARG0]]{{.*}} : memref<4096x32xf16>
16+
// CHECK: %[[ELEM:.+]] = vector.extract %[[LOAD]][0] : f16 from vector<1xf16>
1617
// CHECK: %[[SPLAT:.+]] = vector.splat %[[ELEM]] : vector<8xf16>
1718
// CHECK: %[[INSERT:.+]] = vector.insert %[[SPLAT]], %[[INIT]] [0] : vector<8xf16> into vector<1x8xf16>
1819
// CHECK: return %[[INSERT]]

compiler/src/iree/compiler/Codegen/VMVX/VMVXLowerLinalgMicrokernels.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ bool verifyMemRefInnerDimsContiguousRowMajor(MemRefType type) {
9494
return true;
9595
}
9696

97-
if (failed(mlir::getStridesAndOffset(type, strides, offset))) {
97+
if (failed(type.getStridesAndOffset(strides, offset))) {
9898
return false;
9999
}
100100

compiler/src/iree/compiler/Dialect/Util/Conversion/MemRefToUtil/Patterns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static Value getByteOffsetForIndices(OpBuilder &builder, Location loc,
5858
}
5959
SmallVector<int64_t> strides;
6060
int64_t offset;
61-
if (failed(getStridesAndOffset(memrefType, strides, offset)) ||
61+
if (failed(memrefType.getStridesAndOffset(strides, offset)) ||
6262
strides[0] != 1) {
6363
emitError(loc, "expected memref stride 1");
6464
return {};

compiler/src/iree/compiler/Dialect/Util/IR/UtilOps.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,12 @@ def Util_AlignOp : Util_PureOp<"align", [
346346
}];
347347

348348
let arguments = (ins
349-
SignlessIntegerLike:$value,
350-
SignlessIntegerLike:$alignment
349+
SignlessIntegerOrIndexLike:$value,
350+
SignlessIntegerOrIndexLike:$alignment
351351
);
352352

353353
let results = (outs
354-
SignlessIntegerLike:$result
354+
SignlessIntegerOrIndexLike:$result
355355
);
356356

357357
let assemblyFormat = [{

0 commit comments

Comments
 (0)