summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-03-14 21:23:27 +0000
committerSanjay Patel <spatel@rotateright.com>2018-03-14 21:23:27 +0000
commit11f7f9908b139f480c9571c723ddffa3e8e7a08c (patch)
tree336c899a4b308b4a37c72fa09f4b2266b82640ea /llvm/lib/CodeGen/MachineOperand.cpp
parenta5c1ed340f1abaed46397e547d86986e570c3382 (diff)
downloadbcm5719-llvm-11f7f9908b139f480c9571c723ddffa3e8e7a08c.tar.gz
bcm5719-llvm-11f7f9908b139f480c9571c723ddffa3e8e7a08c.zip
[InstSimplify] fix folds for (0.0 - X) + X --> 0 (PR27151)
As shown in: https://bugs.llvm.org/show_bug.cgi?id=27151 ...the existing fold could miscompile when X is NaN. The fold was also dependent on 'ninf' but that's not necessary. From IEEE-754 (with default rounding which we can assume for these opcodes): "When the sum of two operands with opposite signs (or the difference of two operands with like signs) is exactly zero, the sign of that sum (or difference) shall be +0...However, x + x = x − (−x) retains the same sign as x even when x is zero." llvm-svn: 327575
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud