diff options
author | Sanjay Patel <spatel@rotateright.com> | 2020-01-15 08:23:46 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2020-01-15 11:14:13 -0500 |
commit | 3180af4362be22d416464f5f3700c456b2f124b9 (patch) | |
tree | 63a93867b47840dd5286f475af47ec84a4ead51d /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 88380b91c87e83fc8984c17d86017df0a3de62aa (diff) | |
download | llvm-3180af4362be22d416464f5f3700c456b2f124b9.zip llvm-3180af4362be22d416464f5f3700c456b2f124b9.tar.gz llvm-3180af4362be22d416464f5f3700c456b2f124b9.tar.bz2 |
[InstCombine] reassociate fsub+fsub into fsub+fadd
As discussed in the motivating PR44509:
https://bugs.llvm.org/show_bug.cgi?id=44509
...we can end up with worse code using fast-math than without.
This is because the reassociate pass greedily transforms fsub
into fneg/fadd and apparently (based on the regression tests
seen here) expects instcombine to clean that up if it wasn't
profitable. But we were missing this fold:
(X - Y) - Z --> X - (Y + Z)
There's another, more specific case that I think we should
handle as shown in the "fake" fneg test (but missed with a real
fneg), but that's another patch. That may be tricky to get
right without conflicting with existing transforms for fneg.
Differential Revision: https://reviews.llvm.org/D72521
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions