Skip to content

Commit 135223e

Browse files
committed
gisel update for icmp
1 parent 73ed27c commit 135223e

File tree

2 files changed

+292
-61
lines changed

2 files changed

+292
-61
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,10 +1478,17 @@ bool AMDGPUInstructionSelector::selectG_ICMP_or_FCMP(MachineInstr &I) const {
14781478
if (Opcode == -1)
14791479
return false;
14801480

1481-
MachineInstr *ICmp = BuildMI(*BB, &I, DL, TII.get(Opcode),
1482-
I.getOperand(0).getReg())
1483-
.add(I.getOperand(2))
1484-
.add(I.getOperand(3));
1481+
MachineInstrBuilder ICmp =
1482+
BuildMI(*BB, &I, DL, TII.get(Opcode), I.getOperand(0).getReg());
1483+
if (AMDGPU::hasNamedOperand(Opcode, AMDGPU::OpName::src0_modifiers))
1484+
ICmp.addImm(0);
1485+
ICmp.add(I.getOperand(2));
1486+
if (AMDGPU::hasNamedOperand(Opcode, AMDGPU::OpName::src1_modifiers))
1487+
ICmp.addImm(0);
1488+
ICmp.add(I.getOperand(3));
1489+
if (AMDGPU::hasNamedOperand(Opcode, AMDGPU::OpName::op_sel))
1490+
ICmp.addImm(0); // op_sel
1491+
14851492
RBI.constrainGenericRegister(ICmp->getOperand(0).getReg(),
14861493
*TRI.getBoolRC(), *MRI);
14871494
bool Ret = constrainSelectedInstRegOperands(*ICmp, TII, TRI, RBI);
@@ -4597,6 +4604,7 @@ AMDGPUInstructionSelector::selectVOP3OpSelMods(MachineOperand &Root) const {
45974604
}};
45984605
}
45994606

4607+
// FIXME-TRUE16 remove when fake16 is removed
46004608
InstructionSelector::ComplexRendererFns
46014609
AMDGPUInstructionSelector::selectVINTERPMods(MachineOperand &Root) const {
46024610
Register Src;

0 commit comments

Comments
 (0)