diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-29 06:55:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-29 06:55:23 +0000 |
commit | 5938bef2d259ca7648481ec3fb4cefbdff22458d (patch) | |
tree | 4055eb8d0661c17a9c09fc8453f0d68ea999a01e /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 112dedc520c1aec387a6fef1c8f512a7d27f0570 (diff) |
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
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 242fffd180..0ee4557563 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<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); |