[PATCH] D11226: AMDPGU/SI: Negative offsets aren't allowed in MUBUF's vaddr operand

Tom Stellard thomas.stellard at amd.com
Wed Jul 15 11:23:20 PDT 2015


tstellarAMD added inline comments.

================
Comment at: test/CodeGen/AMDGPU/scratch-buffer.ll:101-102
@@ +100,4 @@
+if:
+  %ptr_offset = add i32 %offset, 4
+  %array_ptr = getelementptr [8192 x i32], [8192 x i32]* %array, i32 0, i32 %ptr_offset
+  store i32 0, i32* %array_ptr
----------------
arsenm wrote:
> I still don't really understand how this becomes a negative offset. Would another test that adds a negative offset be useful?
Negative immediate offsets don't trigger the bug, because only unsigned immediates get folded into the MUBUF instruction.  The bug occurs when %offset is negative and it is passed to the vaddr operand.


http://reviews.llvm.org/D11226







More information about the llvm-commits mailing list