[llvm] r220063 - R600/SI: Cleanup code with ChangeToFPImmediate

Matt Arsenault Matthew.Arsenault at amd.com
Fri Oct 17 11:00:41 PDT 2014


Author: arsenm
Date: Fri Oct 17 13:00:41 2014
New Revision: 220063

URL: http://llvm.org/viewvc/llvm-project?rev=220063&view=rev
Log:
R600/SI: Cleanup code with ChangeToFPImmediate

Modified:
    llvm/trunk/lib/Target/R600/SIShrinkInstructions.cpp

Modified: llvm/trunk/lib/Target/R600/SIShrinkInstructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIShrinkInstructions.cpp?rev=220063&r1=220062&r2=220063&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIShrinkInstructions.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIShrinkInstructions.cpp Fri Oct 17 13:00:41 2014
@@ -153,10 +153,9 @@ static void foldImmediates(MachineInstr
         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;
         }
       }





More information about the llvm-commits mailing list