[Mlir-commits] [mlir] [mlir][AMDGPU] Fix raw buffer ptr ops lowering (PR #122293)

Fabian Mora llvmlistbot at llvm.org
Thu Jan 9 11:15:05 PST 2025


================
@@ -167,28 +197,36 @@ struct RawBufferOpLowering : public ConvertOpToLLVMPattern<GpuOp> {
 
     MemRefDescriptor memrefDescriptor(memref);
 
-    Value ptr = memrefDescriptor.alignedPtr(rewriter, loc);
+    Value ptr = memrefDescriptor.bufferPtr(
----------------
fabianmcg wrote:

No, we want `bufferPtr`, as it adds the offset to the ptr: https://github.com/llvm/llvm-project/blob/main/mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp#L191-L213

This was one of the causes of subtle bugs when using a memref with non trivial offset, for example when coming from a subview.

https://github.com/llvm/llvm-project/pull/122293


More information about the Mlir-commits mailing list