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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Thu Jun 30 14:22:48 CDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.131 -> 1.132
---
Log message:

FP EXTLOAD is not support on all archs, expand to LOAD and FP_EXTEND

---
Diffs of the changes:  (+9 -0)

 LegalizeDAG.cpp |    9 +++++++++
 1 files changed, 9 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.131 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.132
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.131	Mon Jun 27 18:28:32 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Thu Jun 30 14:22:37 2005
@@ -522,6 +522,15 @@
       AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
       return Result.getValue(Op.ResNo);
     case TargetLowering::Expand:
+      //f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND
+      if (SrcVT == MVT::f32 && Node->getValueType(0) == MVT::f64) {
+        SDOperand Load = DAG.getLoad(SrcVT, Tmp1, Tmp2, Node->getOperand(2));
+        Result = 
+          DAG.getNode(ISD::FP_EXTEND, Node->getValueType(0), Load, SrcVT);
+        if (Op.ResNo)
+          return Load.getValue(1);
+        return Result;
+      }
       assert(Node->getOpcode() != ISD::EXTLOAD &&
              "EXTLOAD should always be supported!");
       // Turn the unsupported load into an EXTLOAD followed by an explicit






More information about the llvm-commits mailing list