| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The previous patches didn't match correctly. Also, we need to make sure that
the conditional is the same before doing the transformation.
llvm-svn: 58978
|
| |
|
|
|
|
| |
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask>
llvm-svn: 58964
|
| |
|
|
|
|
| |
of the select match, not the select instruction itself.
llvm-svn: 58947
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
original code was matching like this:
if (match(A, m_Not(m_Value(B))))
B was already matched as a 'select' instruction. However, this isn't matching
what we think it's matching. It would match B as a 'Value', so basically
anything would match to it. In this case, a Constant matched. B was replaced
with a constant representation. And then the wrong value would be used in the
SelectInst::Create statement, causing a crash.
After thinking on this for a moment, and after Nick L. told me how the pattern
matching stuff was supposed to work, the solution was to match NOT an m_Value,
but an m_Select.
llvm-svn: 58946
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to generate signed ICMP instructions to replace the FCMP. This would violate
the following:
define i1 @test1(i32 %val) {
%1 = uitofp i32 %val to double
%2 = fcmp ole double %1, 0.000000e+00
ret i1 %2
}
would be transformed into:
define i1 @test1(i32 %val) {
%1 = icmp slt i33 %val, 1
ret i1 %1
}
which is obviously wrong. This patch modifes InstCombiner::FoldFCmp_IntToFP_Cst
to handle when the LHS comes from UIToFP.
llvm-svn: 58929
|
| |
|
|
|
|
| |
when simplify a vector.
llvm-svn: 58820
|
| |
|
|
|
|
| |
by Richard Osborne.
llvm-svn: 58555
|
| |
|
|
|
|
|
| |
ConstantInt, and SI is the original cast instruction. This fixes
PR2996.
llvm-svn: 58549
|
| |
|
|
|
|
| |
optimizations accordingly.
llvm-svn: 58457
|
| |
|
|
| |
llvm-svn: 58351
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
to find opportunities for store-to-load forwarding or load CSE,
in the same way that visitStore scans back to do DSE. Also, define
a new helper function for testing whether the addresses of two
memory accesses are known to have the same value, and use it in
both visitStore and visitLoad.
These two changes allow instcombine to eliminate loads in code
produced by front-ends that frequently emit obviously redundant
addressing for memory references.
llvm-svn: 57608
|
| |
|
|
| |
llvm-svn: 57515
|
| |
|
|
|
|
|
| |
- Renumber fcmp predicates to match their icmp counterparts.
- Try swapping operands to expose more optimization opportunities.
llvm-svn: 57513
|
| |
|
|
|
|
|
|
|
| |
e.g. uno && ueq -> ueq
ord && olt -> olt
ord && ueq -> oeq
llvm-svn: 57507
|
| |
|
|
|
|
| |
constant expression with all zero indices as being the same as a bitcast.
llvm-svn: 57442
|
| |
|
|
|
|
|
|
| |
a couple other cases for clarity, but shouldn't affect correctness.
Patch by Eli Friedman!
llvm-svn: 57387
|
| |
|
|
|
|
|
| |
and APFloat::convertToInteger. Restore return value to
IEEE754. Adjust all users accordingly.
llvm-svn: 57329
|
| |
|
|
|
|
| |
patch by Samuel Tardieu!
llvm-svn: 57288
|
| |
|
|
|
|
|
|
| |
shifting and masking inside a bswap expr. This allows it to handle
the cases from PR2842, which involve the intermediate 'or'
expressions being shifted, not just the input value.
llvm-svn: 57095
|
| |
|
|
|
|
| |
ashr. It should only apply to lshr.
llvm-svn: 57089
|
| |
|
|
|
|
|
|
|
|
|
| |
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject. The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.
llvm-svn: 56922
|
| |
|
|
| |
llvm-svn: 56834
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn
Return attributes use 0 as the index.
Function attributes use ~0U as the index.
This patch requires corresponding changes in llvm-gcc and clang.
llvm-svn: 56704
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g
This sets the stage
- to implement function notes as function attributes and
- to distinguish between function attributes and return value attributes.
This requires corresponding changes in llvm-gcc and clang.
llvm-svn: 56622
|
| |
|
|
| |
llvm-svn: 56535
|
| |
|
|
| |
llvm-svn: 56513
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|