R600/SI: Cleanup code with ChangeToFPImmediate

llvm-svn: 220063
This commit is contained in:
Matt Arsenault 2014-10-17 18:00:41 +00:00
parent 6d3cd544bb
commit ffc5d5bbf0
1 changed files with 3 additions and 4 deletions

View File

@ -153,10 +153,9 @@ static void foldImmediates(MachineInstr &MI, const SIInstrInfo *TII,
Src0->ChangeToImmediate(MovSrc.getImm());
ConstantFolded = true;
} else if (MovSrc.isFPImm()) {
const APFloat &APF = MovSrc.getFPImm()->getValueAPF();
if (&APF.getSemantics() == &APFloat::IEEEsingle) {
MRI.removeRegOperandFromUseList(Src0);
Src0->ChangeToImmediate(APF.bitcastToAPInt().getZExtValue());
const ConstantFP *CFP = MovSrc.getFPImm();
if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEsingle) {
Src0->ChangeToFPImmediate(CFP);
ConstantFolded = true;
}
}