| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Recognize expressions like "x > -1 ? x : 0" as min/max and turn them
into expressions like "x < 0 ? 0 : x", which is easily recognizable
as a min/max operation.
- Refrain from folding expression like "y/2 < 1" to "y < 2" when the
comparison is being used as part of a min or max idiom, like
"y/2 < 1 ? 1 : y/2". In that case, the division has another use, so
folding doesn't eliminate it, and obfuscates the min/max, making it
harder to recognize as a min/max operation.
These benefit ScalarEvolution, CodeGen, and anything else that wants to
recognize integer min and max.
llvm-svn: 56246
|
|
|
|
|
|
|
| |
getelementptr indices, inserting an explicit cast if necessary.
This helps expose the sign-extension operation to other optimizations.
llvm-svn: 56133
|
|
|
|
|
|
| |
Patch by Nicolas Capens!
llvm-svn: 56129
|
|
|
|
|
|
|
| |
cases it was still getting lucky and detecting overflow
but it was clearly incorrect.
llvm-svn: 56113
|
|
|
|
|
|
| |
multiplication overflows.
llvm-svn: 56082
|
|
|
|
|
|
| |
condition. This fixes PR2740.
llvm-svn: 56076
|
|
|
|
| |
llvm-svn: 56040
|
|
|
|
|
|
|
|
|
|
|
|
| |
users, and teach it about shufflevector instructions.
Also, fix a subtle bug in SimplifyDemandedVectorElts'
insertelement code.
This is a patch that was originally written by Eli Friedman,
with some fixes and cleanup by me.
llvm-svn: 55995
|
|
|
|
| |
llvm-svn: 55779
|
|
|
|
| |
llvm-svn: 55690
|
|
|
|
|
|
| |
slowdown in bzip2.
llvm-svn: 55113
|
|
|
|
| |
llvm-svn: 55087
|
|
|
|
| |
llvm-svn: 55035
|
|
|
|
|
|
| |
predicate, swap the order of the operands.
llvm-svn: 54907
|
|
|
|
|
|
| |
produce an xor by 127.
llvm-svn: 54906
|
|
|
|
| |
llvm-svn: 54877
|
|
|
|
|
|
|
|
| |
the predicate.
Also, make this optz'n apply in more cases where it's safe to do so.
llvm-svn: 54876
|
|
|
|
|
|
|
|
| |
instcombine
by ~10% on some testcases.
llvm-svn: 54811
|
|
|
|
|
|
|
| |
can have a non-negative result; for example, -16%16 is 0. Also,
clarify the related comments. This fixes PR2670.
llvm-svn: 54767
|
|
|
|
|
|
|
|
|
| |
do for scalars. Patch contributed by Nicolas Capens
This also generalizes the previous xforms to work on long double, now that
isExactlyValue works for long double.
llvm-svn: 54653
|
|
|
|
|
|
| |
when it meant to be emitting undef indices.
llvm-svn: 54417
|
|
|
|
| |
llvm-svn: 54408
|
|
|
|
|
|
| |
matters, the result is undefined anyway.
llvm-svn: 54396
|
|
|
|
|
|
| |
tracking down that this was breaking llvm-gcc bootstrap on Linux.
llvm-svn: 54394
|
|
|
|
|
|
| |
looks bogus. Please see PR2629 for details on why this is breaking things.
llvm-svn: 54372
|
|
|
|
|
|
| |
CodeGen & Clang work coming next.
llvm-svn: 54161
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.
The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.
llvm-svn: 53941
|
|
|
|
| |
llvm-svn: 53715
|
|
|
|
|
|
|
| |
FindInsertedValue, it now performs a number of simple transformations that
should result in the same effect when applied iteratively.
llvm-svn: 53673
|
|
|
|
| |
llvm-svn: 53666
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
disproving a condition. This actually compiles the existing testcase
(udiv_select_to_select_shift) to:
define i64 @test(i64 %X, i1 %Cond) {
entry:
%divisor1.t = lshr i64 %X, 3 ; <i64> [#uses=1]
%quotient2 = lshr i64 %X, 3 ; <i64> [#uses=1]
%sum = add i64 %divisor1.t, %quotient2 ; <i64> [#uses=1]
ret i64 %sum
}
instead of:
define i64 @test(i64 %X, i1 %Cond) {
entry:
%quotient1.v = select i1 %Cond, i64 3, i64 4 ; <i64> [#uses=1]
%quotient1 = lshr i64 %X, %quotient1.v ; <i64> [#uses=1]
%quotient2 = lshr i64 %X, 3 ; <i64> [#uses=1]
%sum = add i64 %quotient1, %quotient2 ; <i64> [#uses=1]
ret i64 %sum
}
llvm-svn: 53534
|
|
|
|
|
|
|
| |
Remove dead code analyzing urem. 'urem' of power-of-2 is canonicalized to an
'and' instruction.
llvm-svn: 53506
|
|
|
|
| |
llvm-svn: 53454
|
|
|
|
| |
llvm-svn: 53452
|
|
|
|
|
|
| |
similar.
llvm-svn: 53451
|
|
|
|
| |
llvm-svn: 53449
|
|
|
|
| |
llvm-svn: 53448
|
|
|
|
| |
llvm-svn: 53447
|
|
|
|
|
|
|
|
| |
the min/max values for an integer type, compare against the min/max
values we can prove contain the input. This might be a tighter bound,
so this is general goodness.
llvm-svn: 53446
|
|
|
|
|
|
| |
handle them in some code.
llvm-svn: 53445
|
|
|
|
|
|
|
| |
was using the algorithm for folding unsigned comparisons which is
completely wrong. This has been broken since the signless types change.
llvm-svn: 53444
|
|
|
|
|
|
|
|
|
|
|
| |
true)
This cause a regression in InstCombine/JavaCompare, which was doing the right
thing on accident. To handle the missed case, generalize the comparisons based
on masked bits a little bit to handle comparisons against the max value. For
example, we can now xform (slt i32 (and X, 4), 4) -> (setne i32 (and X, 4), 4)
llvm-svn: 53443
|
|
|
|
| |
llvm-svn: 53393
|
|
|
|
| |
llvm-svn: 53283
|
|
|
|
| |
llvm-svn: 53282
|
|
|
|
| |
llvm-svn: 53276
|
|
|
|
| |
llvm-svn: 53271
|
|
|
|
|
|
|
|
|
| |
into phis. This is actually the same bug as PR2262 /
2008-04-29-VolatileLoadDontMerge.ll, but I missed checking the first
predecessor for multiple successors. Testcase here:
InstCombine/2008-07-08-VolatileLoadMerge.ll
llvm-svn: 53240
|
|
|
|
| |
llvm-svn: 53177
|
|
|
|
| |
llvm-svn: 53151
|