[llvm] [AMDGPU] Strengthen preload intrinsics to noundef and nonnull (PR #92801)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 12:30:20 PDT 2024


================
@@ -12,11 +12,16 @@
 
 def global_ptr_ty : LLVMQualPointerType<1>;
 
+// The amdgpu-no-* attributes (ex amdgpu-no-workitem-id-z) typically inferred
+// by the backend cause whole-program undefined behavior when violated, such as
+// by causing all other preload register intrinsics to return arbitrarily incorrect
+// values. Outside of such IR-level UB, these preloaded registers are always set
----------------
krzysz00 wrote:

True. That being said, if I want workitem ID Y and I'm being called from a amdgpu-no-workitem-id-y function, that function has to invoke undefined behavior in order to carry out the function call ... or the calling convention preserves the preloaded registers and those become incorrectly laid out like in the entry function.

I'll probably want a better way to word this

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


More information about the llvm-commits mailing list