| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
| |
constant vectors
llvm-svn: 279937
|
| |
|
|
|
|
|
|
| |
Like other recent changes near here, the goal is to allow vector types for
all of these folds. Splitting things up makes it easier to incrementally
enhance the code and easier to read.
llvm-svn: 279851
|
| |
|
|
|
|
|
|
| |
1. Early exit to reduce indent
2. Fix comments and variable names to match
3. Reformat comments / clang-format code
llvm-svn: 279837
|
| |
|
|
| |
llvm-svn: 279834
|
| |
|
|
| |
llvm-svn: 279831
|
| |
|
|
|
|
|
|
|
|
|
| |
Removing the redundant 'CmpRHSV' local variable exposes a bug in the caller
foldICmpShrConstant() - it was sending in the div constant instead of the
cmp constant. But I have not been able to expose this in a regression test
yet - the affected folds all appear to be handled before we ever reach this
code. I'll keep trying to find a case as I make changes to allow vector folds
in both functions.
llvm-svn: 279828
|
| |
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D23590
llvm-svn: 279693
|
| |
|
|
|
|
|
|
|
| |
foldICmpDivConstant(); NFCI
There was no logic in foldICmpDivConstant, so no need for a separate function.
The code is directly copy/pasted, so further cleanups to follow.
llvm-svn: 279685
|
| |
|
|
|
|
| |
constant vectors
llvm-svn: 279677
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r279568; NFC
I deleted a fold from InstCombine at:
https://reviews.llvm.org/rL279568
because it (like any InstCombine to a constant?) should always happen in InstSimplify,
however, it's not obvious what the assumptions are in the remaining code.
Add a comment and assert to make it clearer.
Differential Revision: https://reviews.llvm.org/D23819
llvm-svn: 279626
|
| |
|
|
| |
llvm-svn: 279578
|
| |
|
|
|
|
|
| |
There will only be 3 lines of code in foldICmpShrConst() when the cleanup is done,
so it doesn't make much sense to have a separate function for a single fold.
llvm-svn: 279575
|
| |
|
|
|
|
|
|
| |
AFAICT, these already worked in all cases for scalar types, and I enhanced
the code to work for vector types in:
https://reviews.llvm.org/rL279543
llvm-svn: 279568
|
| |
|
|
|
|
|
|
| |
helpers; NFCI
This saves some casting in the helper functions and eases some further refactoring.
llvm-svn: 279478
|
| |
|
|
|
|
| |
constant vectors
llvm-svn: 279472
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: We can allow sinking if the single user block has only one unique predecessor, regardless of the number of edges. Note that a switch statement with multiple cases can have the same destination.
Reviewers: mcrosier, majnemer, spatel, reames
Subscribers: reames, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D23722
llvm-svn: 279448
|
| |
|
|
|
|
|
|
|
|
|
| |
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 3
This is a partial enablement (move the ConstantInt guard down).
llvm-svn: 279399
|
| |
|
|
|
|
|
|
| |
constant vectors, part 2
This is a partial enablement (move the ConstantInt guard down).
llvm-svn: 279398
|
| |
|
|
|
|
|
|
| |
The callers still have ConstantInt guards, so there is no functional change
intended from this change. But relaxing the callers will allow more folds
for vector types.
llvm-svn: 279396
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Specifically, this is done near the end of "SimplifyICmpInst" using
computeKnownBits() as the broader solution. There are even vector
tests (yay!) for this in test/Transforms/InstSimplify/compare.ll.
I considered putting an assert here instead of just deleting, but
then we could assert every possible fold in InstSimplify in
InstCombine, so...less is more?
llvm-svn: 279300
|
| |
|
|
| |
llvm-svn: 279282
|
| |
|
|
| |
llvm-svn: 279279
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up the existing code by:
1. Renaming variables
2. Adding local variables
3. Making it vector-safe
This is still guarded by a ConstantInt check, so no functional change is intended.
But this should be ready to go: if we move the ConstantInt check down, all of
these folds should do the right thing for vector types.
llvm-svn: 279150
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Also add popcount(n) == bitsize(n) -> n == -1 transformation.
Reviewers: majnemer, spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23134
llvm-svn: 279141
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
https://reviews.llvm.org/rL279077
https://reviews.llvm.org/rL279101
llvm-svn: 279133
|
| |
|
|
|
|
|
| |
1. Fix variable names
2. Add local variables to reduce code
llvm-svn: 279132
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
https://reviews.llvm.org/rL279077
llvm-svn: 279101
|
| |
|
|
|
|
|
| |
1. Better variable names
2. Remove unnecessary check of ConstantInt
llvm-svn: 279094
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
This will enable vector splat folding, but NFC until the callers
have their ConstantInt restrictions removed.
llvm-svn: 279072
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Follow up to r278902. I had missed "fall through", with a space.
llvm-svn: 278970
|
| |
|
|
|
|
|
| |
Use m_APInt for the xor constant, but this is all still guarded by the initial
ConstantInt check, so no vector types should make it in here.
llvm-svn: 278957
|
| |
|
|
|
|
|
|
| |
1. Change variable names
2. Use local variables to reduce code
3. Early exit to reduce indent
llvm-svn: 278955
|
| |
|
|
|
|
|
|
|
|
| |
constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
llvm-svn: 278945
|
| |
|
|
|
|
|
|
|
| |
1. Change variable names
2. Use local variables to reduce code
3. Use ? instead of if/else
4. Use the APInt variable instead of 'RHS' so the removal of the FIXME code will be direct
llvm-svn: 278944
|
| |
|
|
|
|
|
|
|
| |
constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
llvm-svn: 278935
|
| |
|
|
|
|
|
| |
This is a mechanical change of comments in switches like fallthrough,
fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead.
llvm-svn: 278902
|
| |
|
|
|
|
|
|
|
|
|
| |
1. Fix variable names
2. Add local variables to reduce code
3. Fix code comments
4. Add early exit to reduce indentation
5. Remove 'else' after if -> return
6. Hoist common predicate
llvm-svn: 278864
|
| |
|
|
|
|
| |
constant vectors
llvm-svn: 278859
|
| |
|
|
| |
llvm-svn: 278855
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Besides breaking up a 700 line function to improve readability,
this sinks the 'FIXME: ConstantInt' check into each helper. So
now we can independently break that restriction within any of the
helper functions.
As much as possible, the code was only {cut/paste/clang-format}'ed
to minimize risk (no functional changes intended), so several more
readability improvements are still possible.
llvm-svn: 278828
|
| |
|
|
|
|
|
|
|
|
|
| |
There's some formatting and pointer deref ugliness here that I intend to fix in
subsequent patches. The overall goal is to refactor the obnoxiously long switch
and incrementally remove the restriction to scalar types (allow folds for vector
splats). This patch introduces the use of m_APInt which means the RHSV reference
is now a pointer (and may have matched a vector splat), but the check of 'RHS'
remains, so vector folds are disallowed and no functional change is intended.
llvm-svn: 278816
|
| |
|
|
|
|
|
|
| |
This is part of an effort to constify ValueTracking.cpp. This change is
to methods which need const Value* instead of Value* to go with the upcoming
changes to ValueTracking.
llvm-svn: 278528
|
| |
|
|
|
|
|
|
|
| |
If the result of the find is only used to compare against end(), just
use is_contained instead.
No functionality change is intended.
llvm-svn: 278469
|