[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 06:15:39 PDT 2024
perlfu wrote:
> I'm not convinced that this is a bug fix. Sure, if the wwm global flag is not set then we might not set the inactive lanes properly, but if nothing else in the shader is using wwm then why is that a problem?
Semantically I do not think we have defined set.inactive to only be valid for values that are used in WWM.
If we did, then we could lower it to a COPY of the active lanes when where is no WWM in the shader.
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.
https://github.com/llvm/llvm-project/pull/98858
More information about the llvm-commits
mailing list