[llvm] [AMDGPU] Add new llvm.amdgcn.wave.shuffle intrinsic (PR #167372)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 01:52:38 PST 2025


================
@@ -2718,6 +2718,17 @@ def int_amdgcn_call_whole_wave:
              llvm_vararg_ty], // The arguments to the callee.
             [IntrConvergent]>;
 
+// <result>
+//   llvm.amdgcn.wave.shuffle <value> <id>
+// value and result can be 32bit floating-point, integer,
+// or Boolean types, and must be the same type. Any index
+// value that's outside the valid range will wrap around,
+// and reading from an inactive lane will return 0.
----------------
jayfoad wrote:

What you've implemented will return poison, not 0. I prefer poison but I guess it depends on the intended use cases. I think @nhaehnle suggested the intrinsic could take a flag to select between these two behaviours.

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


More information about the llvm-commits mailing list