| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
There's probably a lot more like this (see also comments in D33338 about responsibility),
but I suspect we don't usually get a visible manifestation.
Given the recent interest in improving InstCombine efficiency, another potential micro-opt
that could be repeated several times in this function: morph the existing icmp pred/operands
instead of creating a new instruction.
llvm-svn: 303860
|
|
|
|
|
|
|
|
|
| |
The swapped operands in the first test is a manifestation of an
inefficiency for vectors that doesn't exist for scalars because
the IRBuilder checks for an all-ones mask for scalars, but not
vectors.
llvm-svn: 303818
|
|
|
|
| |
llvm-svn: 303816
|
|
|
|
| |
llvm-svn: 303808
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the InstCombine counterpart to D32954.
I added some comments about the code duplication in:
rL302436
Alive-based verification:
http://rise4fun.com/Alive/dPw
This is a 2nd fix for the problem reported in:
https://bugs.llvm.org/show_bug.cgi?id=32949
Differential Revision: https://reviews.llvm.org/D32970
llvm-svn: 303105
|
|
|
|
|
|
|
| |
A patch for the InstSimplify variant of this bug is up for review here:
https://reviews.llvm.org/D32954
llvm-svn: 302434
|
|
|
|
|
|
|
| |
If we had these tests, the bug caused by https://reviews.llvm.org/rL299851 would have been caught sooner.
There's also an assert in the code that should have caught that bug, but the assert line itself has a bug.
llvm-svn: 300201
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We already have these 'and' folds:
// X & -C == -C -> X > u ~C
// X & -C != -C -> X <= u ~C
// iff C is a power of 2
...but we were missing the 'or' siblings.
http://rise4fun.com/Alive/n6
This should improve:
https://bugs.llvm.org/show_bug.cgi?id=32524
...but there are 2 or more other pieces to fix still.
Differential Revision: https://reviews.llvm.org/D31712
llvm-svn: 299570
|
|
|
|
| |
llvm-svn: 299557
|
|
|
|
|
|
|
| |
Also, move the related existing scalar test to a renamed file
where I'm planning to add more icmp-add tests.
llvm-svn: 294487
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code comments didn't match the code logic, and we didn't actually distinguish the fake unary (not/neg/fneg)
operators from arguments. Adding another level to the weighting scheme provides more structure and can help
simplify the pattern matching in InstCombine and other places.
I fixed regressions that would have shown up from this change in:
rL290067
rL290127
But that doesn't mean there are no pattern-matching logic holes left; some combines may just be missing regression tests.
Should fix:
https://llvm.org/bugs/show_bug.cgi?id=28296
Differential Revision: https://reviews.llvm.org/D27933
llvm-svn: 294049
|
|
|
|
| |
llvm-svn: 292064
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows LLVM to optimize sequences like the following:
%add = add nuw i32 %x, 1
%cmp = icmp ugt i32 %add, %y
Into:
%cmp = icmp uge i32 %x, %y
Previously, only signed comparisons were being handled.
Decrements could also be handled, but 'sub nuw %x, 1' is currently canonicalized to
'add %x, -1' in InstCombineAddSub, losing the nuw flag. Removing that canonicalization
seems like it might have far-reaching ramifications so I kept this simple for now.
Patch by Matti Niemenmaa!
Differential Revision: https://reviews.llvm.org/D24700
llvm-svn: 291975
|
|
|
|
|
|
|
|
| |
As discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108749.html
...we should be able to better optimize this pattern.
llvm-svn: 291262
|
|
|
|
|
|
|
|
|
|
| |
Fixes the FIXMEs in D25952 and rL285075.
Patch by bryant!
Differential Revision: https://reviews.llvm.org/D25955
llvm-svn: 285108
|
|
|
|
|
|
| |
trunc transform
llvm-svn: 285075
|
|
|
|
|
|
|
|
|
|
|
|
| |
These 2 helper functions were already using APInt internally, so just
change the API and caller to allow folds for splats. The scalar
regression tests look quite thorough, so I just added a couple of
tests to prove that vectors are handled too.
These folds should be grouped with the other cmp+shift folds though.
That can be an NFC follow-up.
llvm-svn: 281663
|
|
|
|
|
|
| |
Also, clean up the code and comments for the existing folds in foldICmpSubConstant().
llvm-svn: 281631
|
|
|
|
| |
llvm-svn: 281630
|
|
|
|
|
|
| |
constant vectors
llvm-svn: 281613
|
|
|
|
| |
llvm-svn: 281559
|
|
|
|
|
|
|
| |
This reapplies r272987 with a fix for infinitely looping
when the truncated value is another shift of a constant.
llvm-svn: 281379
|
|
|
|
|
|
| |
vectors
llvm-svn: 281107
|
|
|
|
|
|
| |
splat constant vectors
llvm-svn: 280873
|
|
|
|
|
|
|
|
| |
This is a revert of r280676 which was a revert of r280637;
ie, this is r280637 again. It was speculatively reverted to
help debug buildbot failures.
llvm-svn: 280861
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/14952/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Aicmp.ll
llvm-svn: 280676
|
|
|
|
|
|
|
|
| |
The code to calculate 'UsesRemoved' could be simplified.
As-is, that code is a victim of PR30273:
https://llvm.org/bugs/show_bug.cgi?id=30273
llvm-svn: 280637
|
|
|
|
|
|
| |
Converting all of the overflow ops to APInt looked risky, so I've left that as a TODO.
llvm-svn: 280299
|
|
|
|
|
|
| |
constant vectors
llvm-svn: 279937
|
|
|
|
|
|
| |
constant vectors
llvm-svn: 279677
|
|
|
|
|
|
| |
constant vectors
llvm-svn: 279472
|
|
|
|
|
|
|
|
|
|
|
| |
constant vectors, part 4
This concludes the fixes for icmp+shl in this series:
https://reviews.llvm.org/rL279339
https://reviews.llvm.org/rL279398
https://reviews.llvm.org/rL279399
llvm-svn: 279401
|
|
|
|
|
|
|
|
| |
constant vectors, part 2
This is a partial enablement (move the ConstantInt guard down).
llvm-svn: 279398
|
|
|
|
|
|
|
|
|
| |
constant vectors, part 1
This is a partial enablement (move the ConstantInt guard down) because there are many
different folds here and one of the later ones will require reworking 'isSignBitCheck'.
llvm-svn: 279339
|
|
|
|
|
|
|
|
|
|
|
| |
The intended transform is:
// Simplify icmp eq (or (ptrtoint P), (ptrtoint Q)), 0
// -> and (icmp eq P, null), (icmp eq Q, null).
P and Q are both pointer types, but may have different types. We need
two calls to getNullValue() to make the icmps.
llvm-svn: 279271
|
|
|
|
|
|
| |
constant vectors
llvm-svn: 279266
|
|
|
|
|
|
|
|
|
| |
Of course, we really need to refactor and fix all of the cmp predicates,
but this one is interesting because without it, we later perform an
information-losing transform of icmp (shl 1, Y), C, and we can't recover
the better fold.
llvm-svn: 279263
|
|
|
|
| |
llvm-svn: 279259
|
|
|
|
|
|
|
| |
These are implicitly included as part of larger test cases, but they don't
exist stand-alone (and don't happen for vectors...).
llvm-svn: 279257
|
|
|
|
|
|
|
|
|
|
|
|
| |
constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066
llvm-svn: 279077
|
|
|
|
|
|
|
|
|
|
|
| |
constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
llvm-svn: 279066
|
|
|
|
|
|
|
|
| |
Also, add a scalar test to demonstrate one of the intermediate folds that
is necessary to accomplish the existing, multi-step test. And simplify
the vector tests to only check the final piece of that multi-step transform.
llvm-svn: 278995
|
|
|
|
|
|
|
|
|
| |
constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
llvm-svn: 278935
|
|
|
|
|
|
| |
constant vectors
llvm-svn: 278859
|
|
|
|
| |
llvm-svn: 278768
|
|
|
|
| |
llvm-svn: 278765
|
|
|
|
| |
llvm-svn: 278757
|
|
|
|
| |
llvm-svn: 278751
|
|
|
|
| |
llvm-svn: 278737
|
|
|
|
| |
llvm-svn: 278727
|