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

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 22:17:31 PST 2025


ruiling wrote:

> 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.

Since the permlane16-like intrinsics only shuffle within/across 16-lane-wide row. Even the `src1` and `src2` are uniform (I think in real case they should be always a uniform mask), if `src0` is divergent, the result is still divergent (at least the values are non-uniform among different rows).
> 
> 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.

Yes, agree on the complexity of the uniformity of the intrinsic. Maybe this is less important in real case.
Actually, this newly introduced capability would help modeling the uniformity behavior of intrinsic in #167372 accurately.

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


More information about the llvm-commits mailing list