[llvm] [AMDGPU] Document "relaxed buffer OOB mode", update HSA default (PR #134734)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 15 18:45:23 PDT 2025
================
@@ -1136,6 +1136,41 @@ is conservatively correct for OpenCL.
other operations within the same address space.
======================= ===================================================
+Relaxed Buffer OOB (Out Of Bounds) Mode
+---------------------------------------
+
+Instructions that load from or store to buffer resources (and thus, by extension
+buffer fat pointers and buffer strided pointers) generally implement handling for
+out of bounds (OOB) memory accesses, including those that are partially OOB,
+if the buffer resource resource has the required flags set.
+
+When operating on more than 32 bits of data, the `voffset` used for the access
+will be range-checked for each 32-bit word independently. This check uses saturating
+arithmetic and interprets the offset as an unsigned value.
+
+The behavior described above conflicts with the ABI requirements of certain graphics
+APIs that require out of bounds accesses to be handled strictly so that accessed
+that begin out of bounds but then access in-bounds elements (such as loading A
+``<4 x i32>`` beginning at offset ``-4``) still load the three in-bounds integers.
----------------
shiltian wrote:
Just out of curiosity, will it be `<undef, i32, i32, 32>` or `<i32, i32, i32, undef>`?
https://github.com/llvm/llvm-project/pull/134734
More information about the llvm-commits
mailing list