[mlir][amd] fix LLVM::InsertValueOp::create failure to disambiguate#150605
Conversation
|
@llvm/pr-subscribers-mlir @llvm/pr-subscribers-backend-amdgpu Author: Maksim Levental (makslevental) ChangesFull diff: https://github.com/llvm/llvm-project/pull/150605.diff 1 Files Affected:
diff --git a/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp b/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
index bc0d9bf2ea771..b6f6167d1dfb3 100644
--- a/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
+++ b/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
@@ -232,8 +232,8 @@ struct FatRawBufferCastLowering
Value result = MemRefDescriptor::poison(
rewriter, loc,
getTypeConverter()->convertType(op.getResult().getType()));
- result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr,
- kAllocatedPtrPosInMemRefDescriptor);
+ SmallVector<int64_t> pos{kAllocatedPtrPosInMemRefDescriptor};
+ result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr, pos);
result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr,
kAlignedPtrPosInMemRefDescriptor);
result = LLVM::InsertValueOp::create(rewriter, loc, result, offset,
|
|
@llvm/pr-subscribers-mlir-gpu Author: Maksim Levental (makslevental) ChangesFull diff: https://github.com/llvm/llvm-project/pull/150605.diff 1 Files Affected:
diff --git a/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp b/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
index bc0d9bf2ea771..b6f6167d1dfb3 100644
--- a/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
+++ b/mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
@@ -232,8 +232,8 @@ struct FatRawBufferCastLowering
Value result = MemRefDescriptor::poison(
rewriter, loc,
getTypeConverter()->convertType(op.getResult().getType()));
- result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr,
- kAllocatedPtrPosInMemRefDescriptor);
+ SmallVector<int64_t> pos{kAllocatedPtrPosInMemRefDescriptor};
+ result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr, pos);
result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr,
kAlignedPtrPosInMemRefDescriptor);
result = LLVM::InsertValueOp::create(rewriter, loc, result, offset,
|
|
I don't have a windows machine so I'm gonna wait for CI to complete just to be sure... |
| result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr, | ||
| kAllocatedPtrPosInMemRefDescriptor); | ||
| SmallVector<int64_t> pos{kAllocatedPtrPosInMemRefDescriptor}; | ||
| result = LLVM::InsertValueOp::create(rewriter, loc, result, fatPtr, pos); |
There was a problem hiding this comment.
You should be able to do ArrayRef{kAllocated...}
There was a problem hiding this comment.
you have have to do ArrayRef<int64_t>{...} and I thought this was version was clearer but yea you're right.
|
The 2 stage build will take ages, but this fixed https://lab.llvm.org/buildbot/#/builders/207/builds/4343 as well so we know it works. Thanks! A bit confused why you only had to change the first one, but if it works it works. |
It's because the ADL failure is due to |
|
Oh right there's 3 different constants being used, I read them as all being the same. |
…lvm#150605) fixes llvm#149879 (comment) Note this happens because ADL can't disambiguate between `mlir::DenseI64ArrayAttr` and `llvm::ArrayRef<int64_t>` **for the value 0** which I guess is equal to nullptr on some (most?) systems. Note, this only occurs with the value 0.
fixes #149879 (comment)
Note this happens because ADL can't disambiguate between
mlir::DenseI64ArrayAttrandllvm::ArrayRef<int64_t>for the value 0 which I guess is equal to nullptr on some (most?) systems.Note, this only occurs with the value 0.