From ffc5d5bbf0f4fbae85a9166178878d4e76418c77 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 17 Oct 2014 18:00:41 +0000 Subject: [PATCH] R600/SI: Cleanup code with ChangeToFPImmediate llvm-svn: 220063 --- llvm/lib/Target/R600/SIShrinkInstructions.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/R600/SIShrinkInstructions.cpp b/llvm/lib/Target/R600/SIShrinkInstructions.cpp index 5eaf4a54b4b0..fef39781174e 100644 --- a/llvm/lib/Target/R600/SIShrinkInstructions.cpp +++ b/llvm/lib/Target/R600/SIShrinkInstructions.cpp @@ -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; } }