Do not generate a FP_ROUND of f64 to f64.

llvm-svn: 46195
This commit is contained in:
Dale Johannesen 2008-01-20 01:18:38 +00:00
parent 7d2b746f08
commit 949e5a2f8a
1 changed files with 4 additions and 3 deletions

View File

@ -3608,10 +3608,11 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
MVT::ValueType SrcVT = Op.getOperand(0).getValueType(); MVT::ValueType SrcVT = Op.getOperand(0).getValueType();
if (TLI.getConvertAction(SrcVT, DstVT) == TargetLowering::Expand) { if (TLI.getConvertAction(SrcVT, DstVT) == TargetLowering::Expand) {
if (SrcVT == MVT::ppcf128) { if (SrcVT == MVT::ppcf128) {
SDOperand Lo, Hi; SDOperand Lo;
ExpandOp(Node->getOperand(0), Lo, Hi); ExpandOp(Node->getOperand(0), Lo, Result);
// Round it the rest of the way (e.g. to f32) if needed. // Round it the rest of the way (e.g. to f32) if needed.
Result = DAG.getNode(ISD::FP_ROUND, DstVT, Hi, Op.getOperand(1)); if (DstVT!=MVT::f64)
Result = DAG.getNode(ISD::FP_ROUND, DstVT, Result, Op.getOperand(1));
break; break;
} }
// The only other way we can lower this is to turn it into a STORE, // The only other way we can lower this is to turn it into a STORE,