Skip to content

Commit e5dba6a

Browse files
committed
address comment
1 parent 9fea04e commit e5dba6a

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp

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

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
1481+
MachineInstrBuilder ICmp;
1482+
// t16 instructions
1483+
if (AMDGPU::hasNamedOperand(Opcode, AMDGPU::OpName::src0_modifiers)) {
1484+
ICmp = BuildMI(*BB, &I, DL, TII.get(Opcode), I.getOperand(0).getReg())
1485+
.addImm(0)
1486+
.add(I.getOperand(2))
1487+
.addImm(0)
1488+
.add(I.getOperand(3))
1489+
.addImm(0); // op_sel
1490+
} else {
1491+
ICmp = BuildMI(*BB, &I, DL, TII.get(Opcode), I.getOperand(0).getReg())
1492+
.add(I.getOperand(2))
1493+
.add(I.getOperand(3));
1494+
}
14911495

14921496
RBI.constrainGenericRegister(ICmp->getOperand(0).getReg(),
14931497
*TRI.getBoolRC(), *MRI);

0 commit comments

Comments
 (0)