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

Xin Russell Liu via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 07:17:19 PST 2024


GinShio wrote:

> > It is better to describe it as "readanylane(x) is x if x is uniform, otherwise readanylane(x) is undefined".
> 
> Compared to that, `@llvm.assume(@llvm.is.uniform())` actively tells the compiler that the user _knows_ that this use of the value is uniform. But then, if the user is wrong, then the result is undefined anyway. In what way is one better than the other?

Sorry, I don't focus on this for long time. Thanks a lot for testing the `llvm.is.uniform`!!!
We discussed offline: "Yes, we know the value is uniform, we wish the value can be hoisted or other." A typical case is `subgroup add`.
We will try to use `is.uniform`. That's cool!

For this inst, maybe it's not what we want, but also we can continue improve it if necessary...

Thanks again to you and jay for detailed explanation.

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


More information about the llvm-commits mailing list