[Mlir-commits] [mlir] 8e8f195 - [mlir][amd] fix LLVM::InsertValueOp::create failure to disambiguate (#150605)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jul 25 04:56:30 PDT 2025


Author: Maksim Levental
Date: 2025-07-25T07:56:27-04:00
New Revision: 8e8f195322a6194fbe410265ac7a7623312310c8

URL: https://github.com/llvm/llvm-project/commit/8e8f195322a6194fbe410265ac7a7623312310c8
DIFF: https://github.com/llvm/llvm-project/commit/8e8f195322a6194fbe410265ac7a7623312310c8.diff

LOG: [mlir][amd] fix LLVM::InsertValueOp::create failure to disambiguate (#150605)

fixes
https://github.com/llvm/llvm-project/pull/149879#issuecomment-3117145615

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.

Added: 
    

Modified: 
    mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp

Removed: 
    


################################################################################
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,


        


More information about the Mlir-commits mailing list