[llvm] [AMDGPU] Ensure that V_SET_INACTIVE inactive input is WWM computed (PR #98858)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 22:22:09 PDT 2024


perlfu wrote:

> > As it stands you can observe the values it copies into inactive lanes without WWM in the shader. For example, use set.inactive in a divergent branch and read the result after control flow reconvergences. Then you can access any lanes that are active from the reconvergence point that might not have been active in the branch. So I think it stands that we should give those lanes defined values, even if we do not have a use case at present.
> 
> I think it stands that we _should not_ support that kind of usage. It would be impossible to document properly, impossible to use safely, impossible to support reliably. A bit like providing an intrinsic that writes to an arbitrary physical register in the middle of a function, clobbering whatever the register allocator decided to store there.

It's slightly better than having an intrinsic that writes arbitrary registers as the WWM registers have a clearly defined allocation path, so there won't be any truly unexpected lane writes.

If we want to go down the path of lowering this to a COPY outside of WWM uses then I'll do that in #98864 as it is an optimisation and drop this change.


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


More information about the llvm-commits mailing list