History log of /external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fcb7b97892dad5bc6ae55f513f8a111563078996 09-Jul-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: Fix typo in comment for visitICmpInstWithInstAndIntCst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
fecf0d7a0157011964b4f31a7a5374076b1b236c 09-Jul-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: variations on 0xffffffff - x >= 4

The following transforms are valid if -C is a power of 2:
(icmp ugt (xor X, C), ~C) -> (icmp ult X, C)
(icmp ult (xor X, C), -C) -> (icmp uge X, C)

These are nice, they get rid of the xor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
36b6f7409d9f607317de9815ffc10656b608eab7 09-Jul-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: X & -C != -C -> X <= u ~C

Tests were added in r185910 somehow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
11c29bafd584da2e39ee5d885ca2d53035bc1372 09-Jul-2013 David Majnemer <david.majnemer@gmail.com> Commit r185909 was a misapplied patch, fix it


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
377a5c1a87b879b7a05a635ed7bbf125b0b61e28 09-Jul-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: add more transforms

C1-X <u C2 -> (X|(C2-1)) == C1
C1-X >u C2 -> (X|C2) == C1
X-C1 <u C2 -> (X & -C2) == C1
X-C1 >u C2 -> (X & ~C2) == C1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
53fc39992df9c485ea45f28998c1ef99caed63f9 08-Jul-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: Fold X-C1 <u 2 -> (X & -2) == C1

Back in r179493 we determined that two transforms collided with each
other. The fix back then was to reorder the transforms so that the
preferred transform would give it a try and then we would try the
secondary transform. However, it was noted that the best approach would
canonicalize one transform into the other, removing the collision and
allowing us to optimize IR given to us in that form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
c22a4eeec6967454c73d1430398298259e468b92 29-Jun-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: FoldGEPICmp shouldn't change sign of base pointer comparison

Changing the sign when comparing the base pointer would introduce all
sorts of unexpected things like:
%gep.i = getelementptr inbounds [1 x i8]* %a, i32 0, i32 0
%gep2.i = getelementptr inbounds [1 x i8]* %b, i32 0, i32 0
%cmp.i = icmp ult i8* %gep.i, %gep2.i
%cmp.i1 = icmp ult [1 x i8]* %a, %b
%cmp = icmp ne i1 %cmp.i, %cmp.i1
ret i1 %cmp

into:
%cmp.i = icmp slt [1 x i8]* %a, %b
%cmp.i1 = icmp ult [1 x i8]* %a, %b
%cmp = xor i1 %cmp.i, %cmp.i1
ret i1 %cmp

By preserving the original sign, we now get:
ret i1 false

This fixes PR16483.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
df703257c1dafed4cdb803996a5c277d95780799 29-Jun-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: Small whitespace cleanup in FoldGEPICmp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b41f4bbfbd233fae70962a6b4049de2c08da2657 29-Jun-2013 David Majnemer <david.majnemer@gmail.com> InstCombine: Optimize (1 << X) Pred CstP2 to X Pred Log2(CstP2)

We may, after other optimizations, find ourselves with IR that looks
like:

%shl = shl i32 1, %y
%cmp = icmp ult i32 %shl, 32

Instead, we should just compare the shift count:

%cmp = icmp ult i32 %y, 5


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
4dfc257a1ad58be07753bfb96377869cb5dcf8e7 27-Jun-2013 Michael Gottesman <mgottesman@apple.com> Revert "Revert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float.""

This reverts commit r185099.

Looks like both the ppc-64 and mips bots are still failing after I reverted this
change.

Since:

1. The mips bot always performs a clean build,
2. The ppc64-bot failed again after a clean build (I asked the ppc-64
maintainers to clean the bot which they did... Thanks Will!),

I think it is safe to assume that this change was not the cause of the failures
that said builders were seeing. Thus I am recomitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
d6bd98d01c3db23f9a66b1f1b2d3e65eef65382e 27-Jun-2013 Michael Gottesman <mgottesman@apple.com> Revert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float."

This reverts commit r185095. This is causing a FileCheck failure on
the 3dnow intrinsics on at least the mips/ppc bots but not on the x86
bots.

Reverting while I figure out what is going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
4da2ebeefb10390ad16238ae7a1038a987466225 27-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float.

The category which an APFloat belongs to should be dependent on the
actual value that the APFloat has, not be arbitrarily passed in by the
user. This will prevent inconsistency bugs where the category and the
actual value in APFloat differ.

I also fixed up all of the references to this constructor (which were
only in LLVM).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
3facc43ff69947f744f2a7b6ed94649ccb44df02 06-Jun-2013 Jakub Staszak <kubastaszak@gmail.com> Re-apply "Use IRBuilder instead of ConstantInt methods." with the fixed issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
7de80e04d9ced64a95316eec5155b52c163592c2 06-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "Use IRBuilder instead of ConstantInt methods. It simplifies code a little bit."

This reverts commit 183328. It caused pr16244 and broke the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
cc81b38c4ca2ae0ee8bc6a92e531886af94f5bc2 05-Jun-2013 Jakub Staszak <kubastaszak@gmail.com> Use IRBuilder instead of ConstantInt methods. It simplifies code a little bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
fb1cd69b9022cb48dc3b054656cd015474d4f229 12-Apr-2013 David Majnemer <david.majnemer@gmail.com> Simplify (A & ~B) in icmp if A is a power of 2

The transform will execute like so:
(A & ~B) == 0 --> (A & B) != 0
(A & ~B) != 0 --> (A & B) == 0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
59b11c415eb90861223477841913cf7d35b1a1a4 11-Apr-2013 David Majnemer <david.majnemer@gmail.com> Optimize icmp involving addition better

Allows LLVM to optimize sequences like the following:

%add = add nsw i32 %x, 1
%cmp = icmp sgt i32 %add, %y

into:

%cmp = icmp sge i32 %x, %y

as well as:

%add1 = add nsw i32 %x, 20
%add2 = add nsw i32 %y, 57
%cmp = icmp sge i32 %add1, %add2

into:

%add = add nsw i32 %y, 37
%cmp = icmp sle i32 %cmp, %x


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
03fceff6f69a0261a767aab8e62de8aa9301b86c 05-Apr-2013 Jim Grosbach <grosbach@apple.com> Tidy up a bit. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
1bb93a912199bda15214d1ee7f3c731b8e9b648d 25-Mar-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> Address issues found by Duncan during post-commit review of r177856.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
35763b1ee700cd29f057494a35095f06d983fe6e 25-Mar-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> InstCombine: simplify comparisons to zero of (shl %x, Cst) or (mul %x, Cst)

This simplification happens at 2 places :
- using the nsw attribute when the shl / mul is used by a sign test
- when the shl / mul is compared for (in)equality to zero

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
2be921adc41fb079ce25d36bdd6402ca70d56451 22-Mar-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> InstCombine: Improve the result bitvect type when folding (cmp pred (load (gep GV, i)) C) to a bit test.

The original code used i32, and i64 if legal. This introduced unneeded
casts when they aren't legal, or when the index variable i has another
type. In order of preference: try to use i's type; use the smallest
fitting legal type (using an added DataLayout method); default to i32.
A testcase checks that this works when the index gep operand is i16.

Patch by : Ahmed Bougacha <ahmed.bougacha@gmail.com>
Reviewed by : Duncan

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
bdd2d981391bd9329aba669cffcdde0c39373cb1 13-Mar-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> Fix a performance regression when combining to smaller types in icmp (shl %v, C1), C2 :

Only combine when the shl is only used by the icmp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
ad079b274d6ecd3e36fb98099864baeeeb96ac82 15-Feb-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> Fix refactoring mistake in "Teach InstCombine to work with smaller legal types..."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
7c5c9b39c91d5f53284011c0ddbf458d553740da 15-Feb-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2

It enables to work with a smaller constant, which is target friendly for those which can compare to immediates.
It also avoids inserting a shift in favor of a trunc, which can be free on some targets.

This used to work until LLVM-3.1, but regressed with the 3.2 release.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
0b8c9a80f20772c3793201ab5b251d3520b9cea3 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
6da2e22dffe9dd0255e10a8934f2879eb7e87868 19-Dec-2012 Paul Redmond <paul.redmond@intel.com> Transform (x&C)>V into (x&C)!=0 where possible

When the least bit of C is greater than V, (x&C) must be greater than V
if it is not zero, so the comparison can be simplified.

Although this was suggested in Target/X86/README.txt, it benefits any
architecture with a directly testable form of AND.

Patch by Kevin Schoedel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
bb9004e0dcef07ef7538784e46bbdd3cb3789d24 13-Dec-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert r170020, "Simplify negated bit test", for now.

This assumes (1 << n) is always not zero. Consider n is greater than word size.
Although I know it is undefined, this transforms undefined behavior hidden.

This led clang unexpected behavior with some failures. I will investigate to fix undefined shl in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
99c86c72b2c01269e054eba043137e8609567f5a 13-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Missed these calls from the previous rename somehow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
63522b1998289e694385a45a719313c95f3350cf 12-Dec-2012 David Majnemer <david.majnemer@gmail.com> Simplify negated bit test


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
4f0dfbb454ea8110459e2d1ee5f92e74cb3e8a5c 16-Nov-2012 Duncan Sands <baldrick@free.fr> Make this easier to understand, as suggested by Chandler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
afe4539f8ea9e12404dce0d67b421d8decb2f0fb 16-Nov-2012 Duncan Sands <baldrick@free.fr> Fix PR14361: wrong simplification of A+B==B+A. You may think that the old logic
replaced by this patch is equivalent to the new logic, but you'd be wrong, and
that's exactly where the bug was. There's a similar bug in instsimplify which
manifests itself as instsimplify failing to simplify this, rather than doing it
wrong, see next commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
426c2bf5cdd2173e4a33aea8cb92cf684a724f4b 01-Nov-2012 Chandler Carruth <chandlerc@gmail.com> Revert the majority of the next patch in the address space series:

r165941: Resubmit the changes to llvm core to update the functions to
support different pointer sizes on a per address space basis.

Despite this commit log, this change primarily changed stuff outside of
VMCore, and those changes do not carry any tests for correctness (or
even plausibility), and we have consistently found questionable or flat
out incorrect cases in these changes. Most of them are probably correct,
but we need to devise a system that makes it more clear when we have
handled the address space concerns correctly, and ideally each pass that
gets updated would receive an accompanying test case that exercises that
pass specificaly w.r.t. alternate address spaces.

However, from this commit, I have retained the new C API entry points.
Those were an orthogonal change that probably should have been split
apart, but they seem entirely good.

In several places the changes were very obvious cleanups with no actual
multiple address space code added; these I have not reverted when
I spotted them.

In a few other places there were merge conflicts due to a cleaner
solution being implemented later, often not using address spaces at all.
In those cases, I've preserved the new code which isn't address space
dependent.

This is part of my ongoing effort to clean out the partial address space
code which carries high risk and low test coverage, and not likely to be
finished before the 3.2 release looms closer. Duncan and I would both
like to see the above issues addressed before we return to these
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
ece6c6bb6329748b92403c06ac87f45c43485911 01-Nov-2012 Chandler Carruth <chandlerc@gmail.com> Revert the series of commits starting with r166578 which introduced the
getIntPtrType support for multiple address spaces via a pointer type,
and also introduced a crasher bug in the constant folder reported in
PR14233.

These commits also contained several problems that should really be
addressed before they are re-committed. I have avoided reverting various
cleanups to the DataLayout APIs that are reasonable to have moving
forward in order to reduce the amount of churn, and minimize the number
of commits that were reverted. I've also manually updated merge
conflicts and manually arranged for the getIntPtrType function to stay
in DataLayout and to be defined in a plausible way after this revert.

Thanks to Duncan for working through this exact strategy with me, and
Nick Lewycky for tracking down the really annoying crasher this
triggered. (Test case to follow in its own commit.)

After discussing with Duncan extensively, and based on a note from
Micah, I'm going to continue to back out some more of the more
problematic patches in this series in order to ensure we go into the
LLVM 3.2 branch with a reasonable story here. I'll send a note to
llvmdev explaining what's going on and why.

Summary of reverted revisions:

r166634: Fix a compiler warning with an unused variable.
r166607: Add some cleanup to the DataLayout changes requested by
Chandler.
r166596: Revert "Back out r166591, not sure why this made it through
since I cancelled the command. Bleh, sorry about this!
r166591: Delete a directory that wasn't supposed to be checked in yet.
r166578: Add in support for getIntPtrType to get the pointer type based
on the address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
3467b9fd5d0c4ebc726e96c2af96610e2d6915f9 30-Oct-2012 Ulrich Weigand <ulrich.weigand@de.ibm.com> Enable some additional constant folding for PPCDoubleDouble.
This fixes Clang :: CodeGen/complex-builtints.c on PowerPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b52fb876171e3670e7307fda4459ca005d49d9f5 24-Oct-2012 Micah Villmow <villmow@gmail.com> Add some cleanup to the DataLayout changes requested by Chandler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
aa76e9e2cf50af190de90bc778b7f7e42ef9ceff 24-Oct-2012 Micah Villmow <villmow@gmail.com> Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the
clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
2c39b15073db81d93bb629303915b7d7e5d088dc 15-Oct-2012 Micah Villmow <villmow@gmail.com> Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
fb384d61c78b60787ed65475d8403aee65023962 11-Oct-2012 Micah Villmow <villmow@gmail.com> Revert 165732 for further review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
f3840d2c16a4ec4c879a8ded402835746de380f8 11-Oct-2012 Micah Villmow <villmow@gmail.com> Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
3574eca1b02600bac4e625297f4ecf745f4c4f32 08-Oct-2012 Micah Villmow <villmow@gmail.com> Move TargetData to DataLayout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
a4b5717ea7ea09afeb5cda2683f6e91a802f5906 19-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Fix a crasher when encountering a function pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
c279ecd23c7902fbc6b436cfd8b7957607711281 18-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove overly conservative hasOneUse check, this always expands into a single IR instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
00abcd3da0f36a88fb3c73586a59d782c35e17a6 18-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Add a couple of fabs identities for comparing with 0.0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
f12c95a8af22771845fa16253ad04e90741f5602 08-Aug-2012 Bob Wilson <bob.wilson@apple.com> Fix a serious typo in InstCombine's optimization of comparisons.

An unsigned value converted to floating-point will always be greater than
a negative constant. Unfortunately InstCombine reversed the check so that
unsigned values were being optimized to always be greater than all positive
floating-point constants. <rdar://problem/12029145>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
7a99b467df7cf4505612a11109ed7f05ba40abf1 11-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: factor code better.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
66821d902040f838a97bf04a4b910fdc11ba49a9 10-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Turn (zext A) == (B & (1<<X)-1) into A == (trunc B), narrowing the compare.

This saves a cast, and zext is more expensive on platforms with subreg support
than trunc is. This occurs in the BSD implementation of memchr(3), see PR12750.
On the synthetic benchmark from that bug stupid_memchr and bsd_memchr have the
same performance now when not inlining either function.

stupid_memchr: 323.0us
bsd_memchr: 321.0us
memchr: 479.0us

where memchr is the llvm-gcc compiled bsd_memchr from osx lion's libc. When
inlining is enabled bsd_memchr still regresses down to llvm-gcc memchr time,
I haven't fully understood the issue yet, something is grossly mangling the
loop after inlining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
5b6dfee28e86529030cabdc356e00b4d70747d65 11-May-2012 Eli Friedman <eli.friedman@gmail.com> Fix a minor logic mistake transforming compares in instcombine. PR12514.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
26c8dcc692fb2addd475446cfff24d6a4e958bca 04-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Always compute all the bits in ComputeMaskedBits.
This allows us to keep passing reduced masks to SimplifyDemandedBits, but
know about all the bits if SimplifyDemandedBits fails. This allows instcombine
to simplify cases like the one in the included testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
a42d5c425251b6f30d46744d494817f788c408be 21-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix unsigned off-by-one in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
8294eb5599092e3d8e95c9c4d323ffa139499acf 21-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Don't transform a signed icmp of two GEPs into a signed compare of the indices.

This transformation is not safe in some pathological cases (signed icmp of pointers should be an
extremely rare thing, but it's valid IR!). Add an explanatory comment.

Kudos to Duncan for pointing out this edge case (and not giving up explaining it until I finally got it).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
6ad48f413743366c91b088a8e39d7f882200429d 20-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Removing the base from the address calculation is only safe when the GEPs are inbounds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
9bb40853eeef1d11b626bdc58e00121e35187866 20-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: When comparing two GEPs that were derived from the same base pointer but use different types, expand the offset calculation and to the compare on the offset if profitable.

This came up in SmallVector code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
a2e0f6b643e9cfbbd698dbc9eb0289e5e33f8dc9 14-Feb-2012 Devang Patel <dpatel@apple.com> Check against umin while converting fcmp into an icmp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
c8d75c78ec5d30db0d5b75bd8bc85dd65106868f 31-Jan-2012 Chris Lattner <sabre@nondot.org> enhance logic to support ConstantDataArray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
ce16339930a2b03e53b4e6399ef59c092a7f2cfa 17-Dec-2011 Dan Gohman <gohman@apple.com> The powers that be have decided that LLVM IR should now support 16-bit
"half precision" floating-point with a first-class type.

This patch adds basic IR support (but not codegen support).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
aab8e28d5e470711d80276bbf717408c3ab966fd 02-Dec-2011 Chad Rosier <mcrosier@apple.com> Fix a few more places where TargetData/TargetLibraryInfo is not being passed.
Add FIXMEs to places that are non-trivial to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
165695d26161912f528e0a8dca0f22e9b6cfa57b 01-Dec-2011 Pete Cooper <peter_cooper@apple.com> Improved fix for abs(val) != 0 to check other similar case. Also fixed style issues and confusing comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
65a6b57c330361d1075af146300d6aab9059659c 01-Dec-2011 Pete Cooper <peter_cooper@apple.com> Added instcombine pattern to spot comparing -val or val against 0.
(val != 0) == (-val != 0) so "abs(val) != 0" becomes "val != 0"

Fixes <rdar://problem/10482509>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
54b92113e227db1d982172df18c4ad5058aae4e9 29-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add a missing safety check to ProcessUGT_ADDCST_ADD. Fixes PR11438.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
68e05fb3687ca68d5a5be49100c7c274a3185525 30-Sep-2011 Jim Grosbach <grosbach@apple.com> Don't modify constant in-place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
cbf676b3ba907f72405a02938f5cd85fb3e6a46c 30-Sep-2011 Jim Grosbach <grosbach@apple.com> float comparison to double 'zero' constant can just be a float 'zero.'

InstCombine was incorrectly considering the conversion of the constant
zero to be unsafe.

We want to transform:
define float @bar(float %x) nounwind readnone optsize ssp {
%conv = fpext float %x to double
%cmp = fcmp olt double %conv, 0.000000e+00
%conv1 = zext i1 %cmp to i32
%conv2 = sitofp i32 %conv1 to float
ret float %conv2
}

Into:
define float @bar(float %x) nounwind readnone optsize ssp {
%cmp = fcmp olt float %x, 0.000000e+00 ; <---- This
%conv1 = zext i1 %cmp to i32
%conv2 = sitofp i32 %conv1 to float
ret float %conv2
}


rdar://10215914


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
0cc4a958f3f27dafd5c6039962f3e3ddb17ba39f 30-Sep-2011 Jim Grosbach <grosbach@apple.com> Tidy up. Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
a9390a4d5f5d568059a80970d22194b165d097a7 27-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit.

If someone prefers %tmp42 to %42, run instnamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
747032522f9f3b2d9bae71aa303c1a0fd953eee9 20-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Clean up includes of llvm/Analysis/ConstantFolding.h so it's included where it's used and not included where it isn't.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
db125cfaf57cc83e7dd7453de2d509bc8efd0e5e 18-Jul-2011 Chris Lattner <sabre@nondot.org> land David Blaikie's patch to de-constify Type, with a few tweaks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
c73b24db5f6226ed44ebc44ce1c25bb357206623 15-Jul-2011 Chris Lattner <sabre@nondot.org> start using the new helper methods a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
eb9a85f09e18b3fe88499710404b38d3a9128f62 14-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Change Intrinsic::getDeclaration and friends to take an ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
fc6d3a49867cd38954dc40936a88f1907252c6d2 13-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
5fdd6c8793462549e3593890ec61573da06e3346 12-Jul-2011 Jay Foad <jay.foad@gmail.com> Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
2280ebd61416b73d0b6137f275b25af82e268d1f 12-Jul-2011 Bill Wendling <isanbard@gmail.com> Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U include/llvm/Target/TargetData.h
U include/llvm/DerivedTypes.h
U tools/bugpoint/ExtractFunction.cpp
U unittests/Support/TypeBuilderTest.cpp
U lib/Target/ARM/ARMGlobalMerge.cpp
U lib/Target/TargetData.cpp
U lib/VMCore/Constants.cpp
U lib/VMCore/Type.cpp
U lib/VMCore/Core.cpp
U lib/Transforms/Utils/CodeExtractor.cpp
U lib/Transforms/Instrumentation/ProfilingUtils.cpp
U lib/Transforms/IPO/DeadArgumentElimination.cpp
U lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G include/llvm/DerivedTypes.h
U include/llvm/Support/TypeBuilder.h
U include/llvm/Intrinsics.h
U unittests/Analysis/ScalarEvolutionTest.cpp
U unittests/ExecutionEngine/JIT/JITTest.cpp
U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U unittests/VMCore/PassManagerTest.cpp
G unittests/Support/TypeBuilderTest.cpp
U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U lib/VMCore/IRBuilder.cpp
G lib/VMCore/Type.cpp
U lib/VMCore/Function.cpp
G lib/VMCore/Core.cpp
U lib/VMCore/Module.cpp
U lib/AsmParser/LLParser.cpp
U lib/Transforms/Utils/CloneFunction.cpp
G lib/Transforms/Utils/CodeExtractor.cpp
U lib/Transforms/Utils/InlineFunction.cpp
U lib/Transforms/Instrumentation/GCOVProfiling.cpp
U lib/Transforms/Scalar/ObjCARC.cpp
U lib/Transforms/Scalar/SimplifyLibCalls.cpp
U lib/Transforms/Scalar/MemCpyOptimizer.cpp
G lib/Transforms/IPO/DeadArgumentElimination.cpp
U lib/Transforms/IPO/ArgumentPromotion.cpp
U lib/Transforms/InstCombine/InstCombineCompares.cpp
U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U lib/Transforms/InstCombine/InstCombineCalls.cpp
U lib/CodeGen/DwarfEHPrepare.cpp
U lib/CodeGen/IntrinsicLowering.cpp
U lib/Bitcode/Reader/BitcodeReader.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
f362affa3a695164a94d275fb44d18f44ebb855a 11-Jul-2011 Jay Foad <jay.foad@gmail.com> De-constify Types in FunctionType::get().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
fc87cdc1f4df357167a7cef91af92b5012934124 04-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> PR10267: Don't combine an equality compare with an AND into an inequality compare when the AND has more than one use.

This can pessimize code, inequalities are generally more expensive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
e7fdcad2f2d82c81684cb9962327330786c35107 13-Jun-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Fold A-b == C --> b == A-C if A and C are constants.

The backend already knew this trick.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
ffd0ae64c497d13956d16526c46245bfbf48e91f 13-Jun-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Shrink ((zext X) & C1) == C2 to fold away the cast if the "zext" and the "and" have one use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
7e7c9cc31a9c0ca337235ae04fc268e58da1d01b 13-Jun-2011 Benjamin Kramer <benny.kra@googlemail.com> Simplify code. No functionality changes, name changes aside.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
a831a9b972f1b4fa4f3457acf303abbfc71c1ede 26-May-2011 Eli Friedman <eli.friedman@gmail.com> PR9998: ashr exact %x, 31 is not equivalent to sdiv exact %x, -2147483648.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
107ffd58f70651cc928416f6aaf267accc992c23 19-May-2011 Eli Friedman <eli.friedman@gmail.com> More instcombine simplifications towards better debug locations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
67f071e69795dca1151cdb8d57d222b6f041d748 14-May-2011 Stuart Hastings <stuart@apple.com> Avoid combining GEPs that might overflow at runtime.
rdar://problem/9267970

Patch by Julien Lerouge!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b6e7cd655c6ee119dbeacc321ee92387f983edb0 05-May-2011 Eli Friedman <eli.friedman@gmail.com> PR9838: Fix transform introduced in r127064 to not trigger when only one side of the icmp is an exact shift.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
325eeb1cd7c3247ead1513204bc9cf4b6e883653 26-Apr-2011 Chris Lattner <sabre@nondot.org> Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
when X has multiple uses. This is useful for exposing secondary optimizations,
but the X86 backend isn't ready for this when X has a single use. For example,
this can disable load folding.

This is inching towards resolving PR6627.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
5036ce4a64caaeaff4b1f8f1c91836cc2e49a455 26-Apr-2011 Chris Lattner <sabre@nondot.org> some random cleanups, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
7a2bdde0a0eebcd2125055e0eacaca040f0b766c 15-Apr-2011 Chris Lattner <sabre@nondot.org> Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
7ebdc37d2bbfc62ff7957b346bb3a91eb6044d5f 31-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: APFloat can't perform arithmetic on PPC double doubles, don't even try.

Thanks Eli!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
00e00d693c3991d85ffebf305ddbfd5dfb99ead6 31-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Fix transform to use the swapped predicate.

Thanks Frits!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
68b4bd0a63156a9f57210243bc5a8959e93b24fa 31-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, y

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
0db50189dcde3408134e9011052ed8b731ec303a 31-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: fold fcmp pred (fneg x), C -> fcmp swap(pred) x, -C

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b194bdc03b6aa932ba4f719a8aa02db8d498f364 31-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: Shrink "fcmp (fpext x), C" to "fcmp x, C" if C can be losslessly converted to the type of x.

Fixes PR9592.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
cd0274ca189040a2fd883b00a678184afc2cda3a 31-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> InstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
dcf77575d25ad4841e585afa27bc5ee62b32d9fd 08-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Reorder comments to put them the right way around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
d01f50f42ce60207ed6d27fb1778e456d83be06c 06-Mar-2011 Nick Lewycky <nicholas@mxc.ca> ConstantInt has some getters which return ConstantInt's or ConstantVector's of
the value splatted into every element. Extend this to getTrue and getFalse which
by providing new overloads that take Types that are either i1 or <N x i1>. Use
it in InstCombine to add vector support to some code, fixing PR8469!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
58bfcdbcf6a7c1cac0187f7c6beb3afe9d8f5411 05-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Thread comparisons over udiv/sdiv/ashr/lshr exact and lshr nuw/nsw whenever
possible. This goes into instcombine and instsimplify because instsimplify
doesn't need to check hasOneUse since it returns (almost exclusively) constants.

This fixes PR9343 #4 #5 and #8!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
9feda1730c225589e144fb1f86a86a8cf3f39c9e 05-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Try once again to optimize "icmp (srem X, Y), Y" by turning the comparison into
true/false or "icmp slt/sge Y, 0".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
3dc7e49c70726cb47829fb892938ff75a9c9e626 28-Feb-2011 Nick Lewycky <nicholas@mxc.ca> srem doesn't actually have the same resulting sign as its numerator, you could
also have a zero when numerator = denominator. Reverts parts of r126635 and
r126637.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b042f8e9699dd15d7ac48bb9b9475122b1673687 28-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Teach InstCombine to fold "(shr exact X, Y) == 0" --> X == 0, fixing #1 from
PR9343.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
d8d1584c13c554349c235177b2b89cb5117347b2 28-Feb-2011 Nick Lewycky <nicholas@mxc.ca> The sign of an srem instruction is the sign of its dividend (the first
argument), regardless of the divisor. Teach instcombine about this and fix
test7 in PR9343!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
39a7de72c8b5013f32802ceacefaaf6697726c28 18-Feb-2011 Duncan Sands <baldrick@free.fr> Add some transforms of the kind X-Y>X -> 0>Y which are valid when there is no
overflow. These subsume some existing equality transforms, so zap those.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
a77243300ba1a40c80c0f8417ba74bb76e7de279 17-Feb-2011 Duncan Sands <baldrick@free.fr> Transform "A + B >= A + C" into "B >= C" if the adds do not wrap. Likewise for some
variations (some of these were already present so I unified the code). Spotted by my
auto-simplifier as occurring a lot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
e5116f840eedbc3cffa31adc683b4e37d53f2c7a 13-Feb-2011 Chris Lattner <sabre@nondot.org> remove a now-unneccesary cast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
bb75d337c4d544692cd250acba8e3507aacb7b75 13-Feb-2011 Chris Lattner <sabre@nondot.org> implement instcombine folding for things like (x >> c) < 42.
We were previously simplifying divisions, but not right shifts!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
74542aa5001fb6ff3d7d0958b5c391cde63df1ca 13-Feb-2011 Chris Lattner <sabre@nondot.org> refactor some code out into a helper method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b6c8cb442298c79b1319078b3038156466be0c40 11-Feb-2011 Benjamin Kramer <benny.kra@googlemail.com> Also fold (A+B) == A -> B == 0 when the add is commuted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b20c0b5092f11ff349855ec1e732590160aeba23 10-Feb-2011 Chris Lattner <sabre@nondot.org> Enhance the "compare with shift" and "compare with div"
optimizations to be much more aggressive in the face of
exact/nsw/nuw div and shifts. For example, these (which
are the same except the first is 'exact' sdiv:

define i1 @sdiv_icmp4_exact(i64 %X) nounwind {
%A = sdiv exact i64 %X, -5 ; X/-5 == 0 --> x == 0
%B = icmp eq i64 %A, 0
ret i1 %B
}

define i1 @sdiv_icmp4(i64 %X) nounwind {
%A = sdiv i64 %X, -5 ; X/-5 == 0 --> x == 0
%B = icmp eq i64 %A, 0
ret i1 %B
}

compile down to:

define i1 @sdiv_icmp4_exact(i64 %X) nounwind {
%1 = icmp eq i64 %X, 0
ret i1 %1
}

define i1 @sdiv_icmp4(i64 %X) nounwind {
%X.off = add i64 %X, 4
%1 = icmp ult i64 %X.off, 9
ret i1 %1
}

This happens when you do something like:
(ptr1-ptr2) == 42

where the pointers are pointers to non-unit types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
77bc49e5e2e2a5e549d65bc0bedd86ff3df6b161 30-Jan-2011 Anders Carlsson <andersca@mac.com> Recognize and simplify

(A+B) == A -> B == 0
A == (A+B) -> B == 0



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
9d32f60a6f7dbd8e83187481cd2ae0a2f3e726ce 20-Jan-2011 Duncan Sands <baldrick@free.fr> At -O123 the early-cse pass is run before instcombine has run. According to my
auto-simplier the transform most missed by early-cse is (zext X) != 0 -> X != 0.
This patch adds this transform and some related logic to InstructionSimplify
and removes some of the logic from instcombine (unfortunately not all because
there are several situations in which instcombine can improve things by making
new instructions, whereas instsimplify is not allowed to do this). At -O2 this
often results in more than 15% more simplifications by early-cse, and results in
hundreds of lines of bitcode being eliminated from the testsuite. I did see some
small negative effects in the testsuite, for example a few additional instructions
in three programs. One program, 483.xalancbmk, got an additional 35 instructions,
which seems to be due to a function getting an additional instruction and then
being inlined all over the place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
9922ccf4b483ce37524047879f9b2f9bb73e3ccb 16-Jan-2011 Chris Lattner <sabre@nondot.org> remove the AllowAggressive argument to FoldOpIntoPhi. It is forced to false in the
first line of the function because it isn't a good idea, even for compares.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
27a98482bd70dd12eecd02ad600f78a2fc6c16a2 15-Jan-2011 Chris Lattner <sabre@nondot.org> fix typo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
fdb5b01df486f8fca44927a38dc9763e9d538e4c 15-Jan-2011 Chris Lattner <sabre@nondot.org> Catch ~x < cst just like ~x < ~y, we currently handle this through
means that are about to disappear.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
a33b6254bb40488a9574533cadf4cd0b701e97d1 11-Jan-2011 Owen Anderson <resistor@mac.com> Remove dead variable, const-ref-ize an APInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
da1c122da5e1a86c8c2bf20e47a43f5c8fefc4e2 11-Jan-2011 Owen Anderson <resistor@mac.com> Fix a random missed optimization by making InstCombine more aggressive when determining which bits are demanded by
a comparison against a constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
e5cbdca3bd4bc40ca31282531a9292f70648d265 19-Dec-2010 Chris Lattner <sabre@nondot.org> recognize an unsigned add with overflow idiom into uadd.
This resolves a README entry and technically resolves PR4916,
but we still get poor code for the testcase in that PR because
GVN isn't CSE'ing uadd with add, filed as PR8817.

Previously we got:

_test7: ## @test7
addq %rsi, %rdi
cmpq %rdi, %rsi
movl $42, %eax
cmovaq %rsi, %rax
ret

Now we get:

_test7: ## @test7
addq %rsi, %rdi
movl $42, %eax
cmovbq %rsi, %rax
ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
0fe80bbbb6a017169d273c4824903b52a7ea2414 19-Dec-2010 Chris Lattner <sabre@nondot.org> use IC.ReplaceInstUsesWith instead of a raw RAUW so that uses of
the old thing end up on the instcombine worklist. Not doing this
can cause an extra top-level iteration of instcombine, burning
compile time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
0a62474830f50b423329470caeb9a4e4da14a607 19-Dec-2010 Chris Lattner <sabre@nondot.org> generalize the sadd creation code to not require that the
sadd formed is half the size of the original type. We can
now compile this into a sadd.i8:

unsigned char X(char a, char b) {
int res = a+b;
if ((unsigned )(res+128) > 255U)
abort();
return res;
}




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
dd7e83737491b14ebf98e09fa6cb9b515f9f2e3e 19-Dec-2010 Chris Lattner <sabre@nondot.org> fix another miscompile in the llvm.sadd formation logic: it wasn't
checking to see if the high bits of the original add result were dead.
Inserting a smaller add and zexting back to that size is not good enough.

This is likely to be the fix for 8816.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
368397bb7de8318a4663fec846bda714ae78dd7a 19-Dec-2010 Chris Lattner <sabre@nondot.org> fix a bug (possibly 8816) in the sadd forming xform: it isn't
profitable (or safe) to promote code when the add-with-constant
has other uses.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
f0f568b49e111da1258902b73a7b9266222e1842 19-Dec-2010 Chris Lattner <sabre@nondot.org> rework the code added in r122072 to pull it out to its own
helper function, clean up comments, and reduce indentation.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
e63dda51c2b230215837063dba73e9299f8c0aba 17-Dec-2010 Owen Anderson <resistor@mac.com> Reapply r121905 (automatic synthesis of @llvm.sadd.with.overflow) with a fix for a bug that manifested itself
on the DragonEgg self-host bot. Unfortunately, the testcase is pretty messy and doesn't reduce well due to
interactions with other parts of InstCombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
ebef48ea4b0d838d2e4f05024a517bf18b1cc110 16-Dec-2010 Duncan Sands <baldrick@free.fr> Speculatively revert commit 121905 since it looks like it might have broken the
dragonegg self-host buildbot. Original commit message:

Add an InstCombine transform to recognize instances of manual overflow-safe addition
(performing the addition in a wider type and explicitly checking for overflow), and
fold them down to intrinsics. This currently only supports signed-addition, but could
be generalized if someone works out the magic constant formulas for other operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
12984de3140534da4f312190118726963a2b521e 15-Dec-2010 Owen Anderson <resistor@mac.com> Add an InstCombine transform to recognize instances of manual overflow-safe addition
(performing the addition in a wider type and explicitly checking for overflow), and
fold them down to intrinsics. This currently only supports signed-addition, but could
be generalized if someone works out the magic constant formulas for other operations.

Fixes <rdar://problem/8558713>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
40f8f6264d5af2c38e797e0dc59827cd231e8ff7 07-Dec-2010 Jay Foad <jay.foad@gmail.com> PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
7a874ddda037349184fbeb22838cc11a1a9bb78f 01-Dec-2010 Jay Foad <jay.foad@gmail.com> PR5207: Rename overloaded APInt methods set(), clear(), flip() to
setAllBits(), setBit(unsigned), etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
79b967bd9fed0a3147d704ce269af6cc26aff391 23-Nov-2010 Chris Lattner <sabre@nondot.org> duncan's spider sense was right, I completely reversed the condition
on this instcombine xform. This fixes a miscompilation of 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
75d8f599e72c151df48a28bebc6e4e342f469b8a 21-Nov-2010 Chris Lattner <sabre@nondot.org> optimize:
void a(int x) { if (((1<<x)&8)==0) b(); }

into "x != 3", which occurs over 100 times in 403.gcc but in no
other program in llvm-test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
618898e933c6350f1f7976370f3822c086d70f0c 29-Jul-2010 Eli Friedman <eli.friedman@gmail.com> PR7750: !CExpr->isNullValue() only properly computes whether CExpr is nonnull
if CExpr is a ConstantInt.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
3472766f9eb7d66f234c390ce1b3a8b76f0ee9ce 12-Jul-2010 Duncan Sands <baldrick@free.fr> Convert some tab stops into spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
caf70b31b0d8cbae0f05df404dd5935c27369690 24-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
1d9b973fd7e60e4149678a03aac762551c846f13 27-May-2010 Duncan Sands <baldrick@free.fr> Teach instCombine to remove malloc+free if malloc's only uses are comparisons
to null. Patch by Matti Niemenmaa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
551754c4958086cc6910da7c950f2875e212f5cf 17-Apr-2010 Eric Christopher <echristo@apple.com> Revert 101465, it broke internal OpenGL testing.

Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
4ec2258ffb495d7ce00177e447740ef1123a27db 16-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
607a7ab3da72a2eb53553a520507cbb8068dd1d8 16-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101423 and r101397, they break llvm-gcc self-host on darwin10

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
2ff961f66816daab8bbc58a19025161d969821c2 15-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
9ee17208115482441953127615231c59a2f4d052 15-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101364, as it trips the linux nightlybot on some clang C++ tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
165dac08d1bb8428b32a5f39cdd3dbee2888987f 15-Apr-2010 Gabor Greif <ggreif@gmail.com> rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
e05678132345eb8a632362dbd320ee7d36226e67 09-Apr-2010 Dan Gohman <gohman@apple.com> Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
f34f48c57870cf4eb4d48e23b11e29b95d1950c3 05-Mar-2010 Chris Lattner <sabre@nondot.org> Fix PR6503. This turned into a much more interesting and nasty bug. Various
parts of the cmp|cmp and cmp&cmp folding logic wasn't prepared for vectors
(unrelated to the bug but noticed while in the code) and the code was
*definitely* not safe to use by the (cast icmp)|(cast icmp) handling logic
that I added in r95855. Fix all this up by changing the various routines
to more consistently use IRBuilder and not pass in the I which had the wrong
type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
39516a632385cb8103c94fceb6cfed13897a24b4 24-Feb-2010 Dan Gohman <gohman@apple.com> Fix indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
1df9859c40492511b8aa4321eb76496005d3b75b 16-Feb-2010 Duncan Sands <baldrick@free.fr> There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
b0bc6c361da9009e8414efde317d9bbff755f6c0 15-Feb-2010 Duncan Sands <baldrick@free.fr> Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
5f670d41318368e2a5fdc6fe2d385f003c6db68d 01-Feb-2010 Chris Lattner <sabre@nondot.org> cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
9aa1e246dd15dfc73a2f6f44766ca97ba9573c9d 08-Jan-2010 Chris Lattner <sabre@nondot.org> tidy up some stuff duncan pointed out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
033574074d3c980057a0cb989d272ec72a8f9523 05-Jan-2010 Chris Lattner <sabre@nondot.org> optimize comparisons against cttz/ctlz/ctpop, patch by Alastair Lynn!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
d7f5a588907f86ddc83fa29accea54a6c0e78e94 04-Jan-2010 Chris Lattner <sabre@nondot.org> Truncate GEP indexes larger than the pointer size down to pointer size
when doing this transform if the GEP is not inbounds. No testcase because
it is very difficult to trigger this: instcombine already canonicalizes
GEP indices to pointer size, so it relies specific permutations of the
instcombine worklist.

Thanks to Duncan for pointing this possible problem out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
02446fc99abb06d3117d65c0b1f5fba4f906db2e 04-Jan-2010 Chris Lattner <sabre@nondot.org> split instcombine of compares (visit[FI]Cmp) out to
a new InstCombineCompares.cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp