From 5919b48fe92b8addd0057bac9a4482952271971e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 29 Dec 2007 06:55:23 +0000 Subject: [PATCH] don't fold fp_round(fp_extend(load)) -> fp_round(extload) llvm-svn: 45400 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 242fffd18028..0ee455756331 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(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); -- GitLab