Commit Graph

16 Commits

Author SHA1 Message Date
Steven Wu
a511846bdf 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224097 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 04:34:07 +00:00
David Majnemer
643bef9333 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222265 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 22:06:45 +00:00
David Majnemer
063e54286c Revert "Revert r222040 because of bot failure."
This reverts commit r222203, reverting r222040 didn't end up turning the
bot green.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222261 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 21:30:02 +00:00
Manman Ren
8ce35351f8 Revert r222040 because of bot failure.
http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 00:33:22 +00:00
David Majnemer
9019a6092d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222040 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 21:21:15 +00:00
Owen Anderson
774cec5748 Fix more instances of dropped fast math flags when optimizing FADD instructions. All found by inspection (aka grep).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199528 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-18 00:48:14 +00:00
Owen Anderson
03e84c9df9 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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191929 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 21:08:05 +00:00
Owen Anderson
e9d4eba451 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172117 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:06:52 +00:00
Edward O'Callaghan
7aeb9b5e4c Convert the rest of the InstCombine tests from notcast to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 07:18:14 +00:00
Dan Gohman
fce288fc91 Eliminate more uses of llvm-as and llvm-dis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81293 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 00:09:15 +00:00
Dan Gohman
3e054fe9ef Use opt -S instead of piping bitcode output through llvm-dis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 22:34:10 +00:00
Tanya Lattner
76806b6a43 Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48103 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 08:16:40 +00:00
Reid Spencer
3a693b7933 This test needs to use egrep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36012 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 20:02:51 +00:00
Reid Spencer
eacb7020ec For PR950:
Update the test suite to accommodate the change from signed integer types
to signless integer types. The changes were of only a few kinds:

1. Make sure llvm-upgrade is run on the source which does the bulk of the
   changes automatically.

2. Change things like "grep 'int'" to "grep 'i32'"

3. In several tests bitcasting caused the same name to be reused in the
   same type plane. These had to be manually fixed. The fix was (generally)
   to leave the bitcast and provide the instruction with a new name. This
   should not affect the semantics of the test. In a few cases, the
   bitcasts were known to be superfluous and irrelevant to the test case
   so they were removed.

4. One test case uses a bytecode file which needed to be updated to the
   latest bytecode format.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32789 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 06:02:00 +00:00
Reid Spencer
69ccadd753 Use the llvm-upgrade program to upgrade llvm assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-02 04:23:10 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00