Ahmed Bougacha
0ea9d1e753
[IR] fptrunc-of-fptrunc isn't an EliminableCastPair.
...
Double and single rounding can produce different results.
This is the IR counterpart to r228911.
llvm-svn: 238531
2015-05-29 00:04:30 +00:00
Steven Wu
881916dea5
Fix another infinite loop in InstCombine
...
Summary:
InstCombine infinite-loops for the testcase added
It is because InstCombine is generating instructions that can be
optimized by itself. Fix by not optimizing frem if the optimized
type is the same as original type.
rdar://problem/19150820
Reviewers: majnemer
Differential Revision: http://reviews.llvm.org/D6634
llvm-svn: 224097
2014-12-12 04:34:07 +00:00
David Majnemer
c6b8e20a5c
InstCombine: Fix another infinite loop caused by visitFPTrunc
...
We would attempt to replace an frem's operand with the same operand.
This would cause InstCombine to think real work was done, causing
InstCombine to enter an infinite loop.
This fixes the second part of PR21576.
llvm-svn: 222265
2014-11-18 22:06:45 +00:00
David Majnemer
b32eaddf11
Revert "Revert r222040 because of bot failure."
...
This reverts commit r222203, reverting r222040 didn't end up turning the
bot green.
llvm-svn: 222261
2014-11-18 21:30:02 +00:00
Manman Ren
a64bd44fd8
Revert r222040 because of bot failure.
...
http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green.
llvm-svn: 222203
2014-11-18 00:33:22 +00:00
David Majnemer
8c3d92e7e5
InstCombine: Fix infinite loop caused by visitFPTrunc
...
We would attempt to replace a fptrunc of an frem with an identical
fptrunc. This would cause the new fptrunc to be added to the worklist.
Of course, this results in an infinite loop because we will keep
visiting the newly created fptruncs.
This fixes PR21576.
llvm-svn: 222040
2014-11-14 21:21:15 +00:00
Owen Anderson
48b842ef7c
Fix more instances of dropped fast math flags when optimizing FADD instructions. All found by inspection (aka grep).
...
llvm-svn: 199528
2014-01-18 00:48:14 +00:00
Owen Anderson
5797bfd4a3
Pull fptrunc's upwards through selects when one of the select's selectands was a constant. This has a number of benefits, including producing small immediates (easier to materialize, smaller constant pools) as well as being more likely to allow the fptrunc to fuse with a preceding instruction (truncating selects are unusual).
...
llvm-svn: 191929
2013-10-03 21:08:05 +00:00
Owen Anderson
dbf0ca523d
Teach InstCombine to hoist FABS and FNEG through FPTRUNC instructions. The application of these operations commutes with the truncation, so we should prefer to do them in the smallest size we can, to save register space, use smaller constant pool entries, etc.
...
llvm-svn: 172117
2013-01-10 22:06:52 +00:00
Edward O'Callaghan
cbf75a5dc3
Convert the rest of the InstCombine tests from notcast to FileCheck.
...
llvm-svn: 83828
2009-10-12 07:18:14 +00:00
Dan Gohman
c8054d90fb
Eliminate more uses of llvm-as and llvm-dis.
...
llvm-svn: 81293
2009-09-09 00:09:15 +00:00
Dan Gohman
72a13d2476
Use opt -S instead of piping bitcode output through llvm-dis.
...
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Tanya Lattner
aa6f5c9ddd
Remove llvm-upgrade and update tests.
...
llvm-svn: 48103
2008-03-09 08:16:40 +00:00
Reid Spencer
be88bc4cb4
This test needs to use egrep.
...
llvm-svn: 36012
2007-04-14 20:02:51 +00:00
Reid Spencer
83b3d82672
Regression is gone, don't try to find it on clean target.
...
llvm-svn: 33296
2007-01-17 07:59:14 +00:00