[llvm] [AMDGPU] Add intrinsic readanylane (PR #115696)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 11 04:08:21 PST 2024


jayfoad wrote:

The definition of readanylane(x) has to say something like "_if x is uniform_ then the result is x, otherwise the result is undefined". The first part "if x is uniform" means that it is uniform at the place where it is used, not at the place where it is defined. In your example that means that all the dark red cells must have the same value (42) but other green cells could be different.

(Another example of why we have to consider uniformity _at the point of use_ is temporal divergence. You can have a uniform def inside a loop with a divergent exit condition, but a use of that def outside the loop must be considered as divergent.)

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


More information about the llvm-commits mailing list