[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 28 14:58:38 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.56 -> 1.57
---
Log message:

Alpha doesn't have a native f32 extload instruction.


---
Diffs of the changes:  (+5 -1)

 LegalizeDAG.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.56 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.57
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.56	Fri Jan 28 16:52:50 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Fri Jan 28 16:58:25 2005
@@ -256,7 +256,11 @@
       bool isDouble = VT == MVT::f64;
       ConstantFP *LLVMC = ConstantFP::get(isDouble ? Type::DoubleTy :
                                              Type::FloatTy, CFP->getValue());
-      if (isDouble && CFP->isExactlyValue((float)CFP->getValue())) {
+      if (isDouble && CFP->isExactlyValue((float)CFP->getValue()) &&
+          // Only do this if the target has a native EXTLOAD instruction from
+          // f32.
+          TLI.getOperationAction(ISD::EXTLOAD,
+                                 MVT::f32) == TargetLowering::Legal) {
         LLVMC = cast<ConstantFP>(ConstantExpr::getCast(LLVMC, Type::FloatTy));
         VT = MVT::f32;
         Extend = true;






More information about the llvm-commits mailing list