AMDGPU/GlobalISel: Don't use pointless getConstantVRegVal

This is always a G_CONSTANT already
This commit is contained in:
Matt Arsenault 2020-01-30 09:25:47 -05:00 committed by Matt Arsenault
parent addc27bc43
commit d6b83d6ba5
1 changed files with 1 additions and 3 deletions

View File

@ -2727,9 +2727,7 @@ void AMDGPUInstructionSelector::renderTruncImm32(MachineInstrBuilder &MIB,
int OpIdx) const {
assert(MI.getOpcode() == TargetOpcode::G_CONSTANT && OpIdx == -1 &&
"Expected G_CONSTANT");
Optional<int64_t> CstVal = getConstantVRegVal(MI.getOperand(0).getReg(), *MRI);
assert(CstVal && "Expected constant value");
MIB.addImm(CstVal.getValue());
MIB.addImm(MI.getOperand(1).getCImm()->getSExtValue());
}
void AMDGPUInstructionSelector::renderNegateImm(MachineInstrBuilder &MIB,