summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron McInally <cameron.mcinally@nyu.edu>2019-05-09 19:28:52 +0000
committerCameron McInally <cameron.mcinally@nyu.edu>2019-05-09 19:28:52 +0000
commit156eb2828994376108c5d3920533d03e4be71f97 (patch)
treecba3640edfc3678f4bd27431549126cc5b8b7dac
parent412254af75084f8845de8b1959c8e5c29dd12909 (diff)
downloadbcm5719-llvm-156eb2828994376108c5d3920533d03e4be71f97.tar.gz
bcm5719-llvm-156eb2828994376108c5d3920533d03e4be71f97.zip
[CodeGen] Add comment about FSUB <-> FNEG xforms
Differential Revision: https://reviews.llvm.org/D61741 llvm-svn: 360366
-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 4c9e34b533e..59f7af01e8b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -11629,6 +11629,10 @@ SDValue DAGCombiner::visitFSUB(SDNode *N) {
}
// (fsub -0.0, N1) -> -N1
+ // NOTE: It is safe to transform an FSUB(-0.0,X) into an FNEG(X), since the
+ // FSUB does not specify the sign bit of a NaN. Also note that for
+ // the same reason, the inverse transform is not safe, unless fast math
+ // flags are in play.
if (N0CFP && N0CFP->isZero()) {
if (N0CFP->isNegative() ||
(Options.NoSignedZerosFPMath || Flags.hasNoSignedZeros())) {
OpenPOWER on IntegriCloud