summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-29 06:55:23 +0000
committerChris Lattner <sabre@nondot.org>2007-12-29 06:55:23 +0000
commit5919b48fe92b8addd0057bac9a4482952271971e (patch)
treee9c0c59a820f6cacb1f507c61afb9e43e9474bd3
parent8013bd339b571ce36e2f8f20e40411b3c19446f8 (diff)
downloadbcm5719-llvm-5919b48fe92b8addd0057bac9a4482952271971e.tar.gz
bcm5719-llvm-5919b48fe92b8addd0057bac9a4482952271971e.zip
don't fold fp_round(fp_extend(load)) -> fp_round(extload)
llvm-svn: 45400
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 242fffd1802..0ee45575633 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3672,6 +3672,10 @@ SDOperand DAGCombiner::visitFP_EXTEND(SDNode *N) {
ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
MVT::ValueType VT = N->getValueType(0);
+ // If this is fp_round(fpextend), don't fold it, allow ourselves to be folded.
+ if (N->hasOneUse() && (*N->use_begin())->getOpcode() == ISD::FP_ROUND)
+ return SDOperand();
+
// fold (fp_extend c1fp) -> c1fp
if (N0CFP && VT != MVT::ppcf128)
return DAG.getNode(ISD::FP_EXTEND, VT, N0);
OpenPOWER on IntegriCloud