[llvm] AMDGPU/GlobalISel: RegBankLegalize rules for wqm_vote, kill (PR #188382)

Petar Avramovic via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 09:46:01 PDT 2026


petar-avramovic wrote:

Overall think there is discrepancy between description and what sdag does

from the IntrinsicsAMDGPU.td
// Return true if at least one thread within the pixel quad passes true into
// the function.
It looks like always uniform, and should be lowered to
```
i1 %res = int_amdgcn_wqm_vote i1 %in
->
i32 %mask = int_amdgcn_ballot i1 %in
i32 %wqm = int_amdgcn_wqm %mask
i32 %res32 = G_ICMP NE %wqm, 0
i1 %res = G_TRUNC i32 %res32
```
now just selecting s_wqm_b32 is probably fine if we assume true=non-zero false=zero, fine as long as result is not used in math maybe including zext, and only for select?
what I am really complaining about is that this is not UniInVcc for sure, but what it should be I am not sure. 

In summary think it depends on how result is used and in most cases current implementation is producing result as expected. 
My suggestion is that we merge this as is, we can fix it later if some corner cases appears. 

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


More information about the llvm-commits mailing list