[llvm] [TTI] Introduce getInstructionUniformity API for flexible uniformity analysis (PR #137639)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 04:09:25 PST 2025


jayfoad wrote:

> Back to the permlane16. The intrinsic is defined as `llvm.amdgcn.permlane16 <old> <src0> <src1> <src2> <fi> <bound_control>`, it sounds like if any of the first two sources `old`/`src0` is divergent, the result would be divergent. Did I misread?

You have chosen a very complicated example!

permlane16 is like shuffle where `src1` and `src2` are combined to form the lane select argument, so the result is uniform if either `src0` or both `src1` and `src2` are uniform.

However, `old` might also be relevant depending on the value of `fi`. And really it is not clear what the semantics of this intrinsic should be if you try to use it to read from inactive lanes, since in general the compiler cannot guarantee anything about the contents of inactive lanes.

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


More information about the llvm-commits mailing list