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

Xin Russell Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 04:26:57 PST 2024


GinShio wrote:

> With that in mind, does my explanation make sense to you:

Yes, that's a good explanation.

> because the presence of the readanylane() call does not magically make x uniform if it was not already uniform.

IIUC, if x is not uniform outside of if and we used `readanylane`, the transform `C-->A`:
 + is okay, because it's undefined behavior if src of `readanylane` is non-uniform, we can assume it's uniform when used (magically make x uniform). In this case, user shouldn't the intrinsic if they don't guarantee x is uniform when using `readanylane`.
 + is bad, because it's undefined result, we cannot assume that.

We expect the latter.

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


More information about the llvm-commits mailing list