[llvm] [AMDGPU][GlobalISel] Add register bank legalize rules for amdgcn_icmp, amdgcn_fcmp (PR #172017)
Petar Avramovic via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 6 05:03:50 PDT 2026
================
@@ -1449,6 +1449,18 @@ bool RegBankLegalizeHelper::lower(MachineInstr &MI,
return lowerAbsToNegMax(MI);
case AbsToS32:
return lowerAbsToS32(MI);
+ case IcmpI1ToBallot: {
+ // amdgcn.icmp(i1 src, i1 0, NE) -> ballot(src)
+ // This implements the "hack ballot" pattern from SIInstructions.td.
+ // For uniform i1: ballot returns -1 if true, 0 if false.
----------------
petar-avramovic wrote:
this is comment is sketchy, I was trying to reduce number of "unnecessary AND with exec at some point", but don't fully remember the differences, GISEL should be much more transparent in that it does and ballot should return exec (not -1) for uniform true input.
Either way think this line is unnecessary
https://github.com/llvm/llvm-project/pull/172017
More information about the llvm-commits
mailing list