From: Chris Lattner Date: Sat, 29 Dec 2007 06:55:23 +0000 (+0000) Subject: don't fold fp_round(fp_extend(load)) -> fp_round(extload) X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5938bef2d259ca7648481ec3fb4cefbdff22458d;p=oota-llvm.git don't fold fp_round(fp_extend(load)) -> fp_round(extload) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45400 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 242fffd1802..0ee45575633 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3672,6 +3672,10 @@ SDOperand DAGCombiner::visitFP_EXTEND(SDNode *N) { ConstantFPSDNode *N0CFP = dyn_cast(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);