| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 1st attempt at rL374828 inserted the code
at the wrong position (outside of the constant-shift-amount
block). Trying again with an additional test to verify
const-ness.
For a constant shift amount, add the following fold.
shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0)
https://rise4fun.com/Alive/IZ9
Fixes PR42257.
Based on original patch by @zvi (Zvi Rackover)
Differential Revision: https://reviews.llvm.org/D63382
llvm-svn: 374886
|
|
|
|
|
|
| |
This reverts r374828 (git commit 1f40f15d54aac06421448b6de131231d2d78bc75) due to bot breakage
llvm-svn: 374851
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For a constant shift amount, add the following fold.
shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0)
https://rise4fun.com/Alive/IZ9
Fixes PR42257.
Based on original patch by @zvi (Zvi Rackover)
Differential Revision: https://reviews.llvm.org/D63382
llvm-svn: 374828
|
|
|
|
|
|
|
|
| |
The reversion apparently deleted the test/Transforms directory.
Will be re-reverting again.
llvm-svn: 358552
|
|
|
|
|
|
|
|
| |
As it's causing some bot failures (and per request from kbarton).
This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda.
llvm-svn: 358546
|
|
|
|
|
|
|
|
|
| |
I was comparing the demanded-bits implementations between InstCombine
and TargetLowering as part of investigating questions in D42088 and
noticed that this was wrong in IR. We were losing all of the prior
known bits when we got back to the 'zext'.
llvm-svn: 322662
|
|
|
|
| |
llvm-svn: 322660
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
handle cases where one side doesn't simplify, but the other side resolves to an identity value
Summary:
If one side simplifies to the identity value for inner opcode, we can replace the value with just the operation that can't be simplified.
I've removed a couple now unneeded special cases in visitAnd and visitOr. There are probably other cases I missed.
Reviewers: spatel, majnemer, hfinkel, dberlin
Reviewed By: spatel
Subscribers: grandinj, llvm-commits, spatel
Differential Revision: https://reviews.llvm.org/D35451
llvm-svn: 308111
|
|
|
|
|
|
|
|
| |
an inverted compare. NFC
Do the same for (X | (Y & ~X)) -> (X | Y)
llvm-svn: 308104
|
|
|
|
|
|
| |
merge them into a existing test file. NFC
llvm-svn: 308103
|
|
|
|
| |
llvm-svn: 302669
|
|
|
|
| |
llvm-svn: 301800
|
|
|
|
|
|
|
|
| |
The matching here wasn't able to handle all the possible commutes. It always assumed the not would be on the left of the xor, but that's not guaranteed.
Differential Revision: https://reviews.llvm.org/D32474
llvm-svn: 301316
|
|
|
|
|
|
| |
after tricking the operand complexity sorting.
llvm-svn: 301296
|
|
|
|
| |
llvm-svn: 300357
|
|
|
|
|
|
|
|
| |
This adds support for these combines for vectors
(X^C)|Y -> (X|Y)^C iff Y&C == 0
Y|(X^C) -> (X|Y)^C iff Y&C == 0
llvm-svn: 299822
|
|
|
|
| |
llvm-svn: 299821
|
|
|
|
|
|
| |
combine. Also add the commuted versions. NFC
llvm-svn: 299820
|
|
|
|
|
|
|
|
|
|
| |
selects and phis
Currently we only fold with ConstantInt RHS. This generalizes to any Constant RHS.
Differential Revision: https://reviews.llvm.org/D31610
llvm-svn: 299466
|
|
|
|
|
|
| |
with constant argument. NFC
llvm-svn: 299460
|
|
|
|
|
|
| |
and/or/xor with constant argument. NFC
llvm-svn: 299450
|
|
|
|
| |
llvm-svn: 294628
|
|
|
|
| |
llvm-svn: 294625
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This further extends r292179 to support additional binary operators
beyond subtraction.
llvm-svn: 292238
|
|
|
|
|
|
|
| |
This is valid if C2 fits within the bitwidth of X thanks to two's
complement modulo arithmetic.
llvm-svn: 292179
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(PR24942)
computeKnownBits() already works for integer vectors, so allow vector types when calling that from InstCombine.
I don't think the change to use m_APInt in computeKnownBits is strictly necessary because we do check for
ConstantVector later, but it's more efficient to handle the splat case without needing to loop on vector elements.
This should work with InstSimplify, but doesn't yet, so I made that a FIXME comment on the test for PR24942:
https://llvm.org/bugs/show_bug.cgi?id=24942
Differential Revision: https://reviews.llvm.org/D24677
llvm-svn: 281777
|
|
|
|
| |
llvm-svn: 280175
|
|
|
|
|
|
| |
constant vectors
llvm-svn: 277762
|
|
|
|
| |
llvm-svn: 276482
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
false logic (PR27869)
By moving this transform to InstSimplify from InstCombine, we sidestep the problem/question
raised by PR27869:
https://llvm.org/bugs/show_bug.cgi?id=27869
...where InstCombine turns an icmp+zext into a shift causing us to miss the fold.
Credit to David Majnemer for a draft patch of the changes to InstructionSimplify.cpp.
Differential Revision: http://reviews.llvm.org/D21512
llvm-svn: 273200
|
|
|
|
| |
llvm-svn: 273173
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 185909
|
|
|
|
| |
llvm-svn: 81257
|
|
|
|
|
|
| |
of using llvm-as, now that opt supports this.
llvm-svn: 81226
|
|
|
|
| |
llvm-svn: 48103
|
|
|
|
|
|
|
| |
Make use of the END. facility on all files > 1K so that we aren't wasting CPU
cycles searching for RUN: lines that we'll never find.
llvm-svn: 36059
|
|
llvm-svn: 33296
|