[llvm-commits] [llvm] r42979 - /llvm/trunk/lib/VMCore/ConstantFold.cpp

Chris Lattner sabre at nondot.org
Sun Oct 14 22:34:10 PDT 2007


Author: lattner
Date: Mon Oct 15 00:34:10 2007
New Revision: 42979

URL: http://llvm.org/viewvc/llvm-project?rev=42979&view=rev
Log:
avoid an APFloat copy.

Modified:
    llvm/trunk/lib/VMCore/ConstantFold.cpp

Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=42979&r1=42978&r2=42979&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/ConstantFold.cpp (original)
+++ llvm/trunk/lib/VMCore/ConstantFold.cpp Mon Oct 15 00:34:10 2007
@@ -194,7 +194,7 @@
   case Instruction::FPToUI: 
   case Instruction::FPToSI:
     if (const ConstantFP *FPC = dyn_cast<ConstantFP>(V)) {
-      APFloat V = FPC->getValueAPF();
+      const APFloat &V = FPC->getValueAPF();
       uint64_t x[2]; 
       uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
       (void) V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI,





More information about the llvm-commits mailing list