1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Expand (f64 extload f32) to (f64 fp_ext (load f32)) if f64 type action is expand.

llvm-svn: 32527
This commit is contained in:
Evan Cheng 2006-12-13 03:19:57 +00:00
parent d5d848048f
commit e200668366

View File

@ -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(),