diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2015-01-23 07:07:20 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-01-23 07:07:20 +0000 |
| commit | 5059813c2d5edc64e6d3427a5fd0625b853e1b35 (patch) | |
| tree | fc038a669da9003309d44b3e7f774ab599c63e89 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 2d4e4ff77e31f41c19b5d2f28dc23f8aa2a951a8 (diff) | |
| download | bcm5719-llvm-5059813c2d5edc64e6d3427a5fd0625b853e1b35.tar.gz bcm5719-llvm-5059813c2d5edc64e6d3427a5fd0625b853e1b35.zip | |
DAGCombine: always constant fold FMA when target disable FP exceptions
Summary: When trying to constant fold an FMA in the DAG, getNode()
fails to fold the FMA if an operand is not finite. In this case this
patch allows the constant folding if !TLI->hasFloatingPointExceptions()
Reviewers: resistor
Reviewed By: resistor
Subscribers: hfinkel, llvm-commits
Differential Revision: http://reviews.llvm.org/D6912
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 226901
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 24e9df3c71d..c354155b035 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3620,7 +3620,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT, const APFloat &V3 = N3CFP->getValueAPF(); APFloat::opStatus s = V1.fusedMultiplyAdd(V2, V3, APFloat::rmNearestTiesToEven); - if (s != APFloat::opInvalidOp) + if (!TLI->hasFloatingPointExceptions() || s != APFloat::opInvalidOp) return getConstantFP(V1, VT); } break; |

