Skip to content

Commit c4ebc1e

Browse files
committed
produce ops in definite order
1 parent 1710300 commit c4ebc1e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ struct RawBufferOpLowering : public ConvertOpToLLVMPattern<GpuOp> {
218218
} else {
219219
Value maxIndex;
220220
for (uint32_t i = 0, e = memrefType.getRank(); i < e; ++i) {
221-
Value maxThisDim = rewriter.create<LLVM::MulOp>(
222-
loc, memrefDescriptor.size(rewriter, loc, i),
223-
memrefDescriptor.stride(rewriter, loc, i));
221+
Value size = memrefDescriptor.size(rewriter, loc, i);
222+
Value stride = memrefDescriptor.stride(rewriter, loc, i);
223+
Value maxThisDim = rewriter.create<LLVM::MulOp>(loc, size, stride);
224224
maxIndex =
225225
maxIndex ? rewriter.create<LLVM::UMaxOp>(loc, maxIndex, maxThisDim)
226226
: maxThisDim;

mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func.func @gpu_gcn_raw_buffer_load_i32_strided(%buf: memref<16x16xi32, strided<[
3939
// CHECK: %[[ptr:.*]] = llvm.getelementptr %[[algn_ptr]][%[[offset]]] : (!llvm.ptr, i64) -> !llvm.ptr, i32
4040
// CHECK: %[[stride:.*]] = llvm.mlir.constant(0 : i16) : i16
4141
// CHECK: %[[sz_i:.*]] = llvm.extractvalue %[[descriptor]][3, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
42-
// CHECK: %[[stride_i:[0-9_a-zA-Z]*]] = llvm.extractvalue %[[descriptor]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
42+
// CHECK: %[[stride_i:.*]] = llvm.extractvalue %[[descriptor]][4, 0] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
4343
// CHECK: %[[ext_i:.*]] = llvm.mul %[[sz_i]], %[[stride_i]] : i64
4444
// CHECK: %[[sz_j:.*]] = llvm.extractvalue %[[descriptor]][3, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>
4545
// CHECK: %[[stride_j:.*]] = llvm.extractvalue %[[descriptor]][4, 1] : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>

0 commit comments

Comments
 (0)