[llvm] [AMDGPU] Document "relaxed buffer OOB mode", update HSA default (PR #134734)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 15:48:22 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.
----------------
krzysz00 wrote:

`<0, i32, i32, i32>` if you're using whatever the strict Vulkan API is

Ordinary, the left end gives you `<0, 0, 0, 0,>`

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


More information about the llvm-commits mailing list