R600/SI: Cleanup code with ChangeToFPImmediate
llvm-svn: 220063
diff --git a/llvm/lib/Target/R600/SIShrinkInstructions.cpp b/llvm/lib/Target/R600/SIShrinkInstructions.cpp
index 5eaf4a5..fef3978 100644
--- a/llvm/lib/Target/R600/SIShrinkInstructions.cpp
+++ b/llvm/lib/Target/R600/SIShrinkInstructions.cpp
@@ -153,10 +153,9 @@
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;
}
}