Skip to content

Commit d06bcd1

Browse files
committed
address comments
1 parent af15018 commit d06bcd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,9 @@ void SIRegisterInfo::buildSpillLoadStore(
16581658
MIB.addReg(SOffset, SOffsetRegState);
16591659
}
16601660

1661-
int64_t CPol = AMDGPU::isGFX12Plus(ST) && LastUse ? AMDGPU::CPol::TH_LU : 0;
1661+
assert((!LastUse || AMDGPU::isGFX12Plus(ST)) &&
1662+
"last_use operand exists only on GFX12+");
1663+
int64_t CPol = LastUse ? AMDGPU::CPol::TH_LU : 0;
16621664
MIB.addImm(Offset + RegOffset).addImm(CPol);
16631665
if (!IsFlat)
16641666
MIB.addImm(0); // swz
@@ -2244,9 +2246,8 @@ bool SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
22442246
}
22452247
int16_t LastUseIdx =
22462248
AMDGPU::getNamedOperandIdx(MI->getOpcode(), AMDGPU::OpName::last_use);
2247-
bool LastUse = (LastUseIdx != -1)
2248-
? (MI->getOperand(LastUseIdx).getImm() == 1)
2249-
: false;
2249+
bool LastUse =
2250+
LastUseIdx != -1 && MI->getOperand(LastUseIdx).getImm() == 1;
22502251

22512252
buildSpillLoadStore(
22522253
*MBB, MI, DL, Opc, Index, VData->getReg(), VData->isKill(), FrameReg,

0 commit comments

Comments
 (0)