diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-12-13 03:19:57 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-12-13 03:19:57 +0000 |
commit | 548f611baeb53e821e7e80f97722b048ab6b09b2 (patch) | |
tree | eb596825277fd18e227f1a9764ed13265e13737c | |
parent | 98ff3b979af4916ba8a82eda7d77a66cdad31842 (diff) |
Expand (f64 extload f32) to (f64 fp_ext (load f32)) if f64 type action is expand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32527 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 246bbdc6a0..6f54c19f3a 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -4547,6 +4547,16 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){ std::swap(Lo, Hi); } else { MVT::ValueType EVT = LD->getLoadedVT(); + + if (VT == MVT::f64 && EVT == MVT::f32) { + // f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND + SDOperand Load = DAG.getLoad(EVT, Ch, Ptr, LD->getSrcValue(), + LD->getSrcValueOffset()); + // Remember that we legalized the chain. + AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Load.getValue(1))); + ExpandOp(DAG.getNode(ISD::FP_EXTEND, VT, Load), Lo, Hi); + break; + } if (EVT == NVT) Lo = DAG.getLoad(NVT, Ch, Ptr, LD->getSrcValue(), |