| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
| |
equal if both are null. In the test, scope type %t and global @y by adding a
'gep' prefix to them.
llvm-svn: 151452
|
| |
|
|
| |
llvm-svn: 151450
|
| |
|
|
|
|
|
| |
by using llvm::isIdentifiedObject. Also teach it to handle GEPs that have
the same base pointer and constant operands. Fixes PR11238!
llvm-svn: 151449
|
| |
|
|
|
|
| |
code, gep chains can be infinite. Just like "stripPointerCasts", use a set to keep track of visited instructions so we don't recurse infinitely.
llvm-svn: 151383
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
implementing PR12013. We now compile the testcase to:
__Z4testv: ## @_Z4testv
## BB#0: ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
pushq %rbx
subq $64, %rsp
leaq 32(%rsp), %rbx
movq %rbx, (%rsp)
leaq 64(%rsp), %rax
movq %rax, 16(%rsp)
movl $1, 32(%rsp)
leaq 36(%rsp), %rax
movq %rax, 8(%rsp)
leaq (%rsp), %rdi
callq __Z1gRN4llvm11SmallVectorIiLj8EEE
movq (%rsp), %rdi
cmpq %rbx, %rdi
je LBB0_2
## BB#1:
callq _free
LBB0_2: ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
addq $64, %rsp
popq %rbx
ret
instead of:
__Z4testv: ## @_Z4testv
## BB#0:
pushq %rbx
subq $64, %rsp
xorl %eax, %eax
leaq (%rsp), %rbx
addq $32, %rbx
movq %rbx, (%rsp)
movq %rbx, 8(%rsp)
leaq 64(%rsp), %rcx
movq %rcx, 16(%rsp)
je LBB0_2
## BB#1:
movl $1, 32(%rsp)
movq %rbx, %rax
LBB0_2: ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
addq $4, %rax
movq %rax, 8(%rsp)
leaq (%rsp), %rdi
callq __Z1gRN4llvm11SmallVectorIiLj8EEE
movq (%rsp), %rdi
cmpq %rbx, %rdi
je LBB0_4
## BB#3:
callq _free
LBB0_4: ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
addq $64, %rsp
popq %rbx
ret
This doesn't shrink clang noticably though.
llvm-svn: 150944
|
| |
|
|
|
|
| |
LHS->stripPointerCasts() != RHS->stripPointerCasts().
llvm-svn: 150863
|
| |
|
|
|
|
|
| |
Turns out this isn't safe, because the code below depends on LHS and RHS having
the same type.
llvm-svn: 150695
|
| |
|
|
| |
llvm-svn: 150694
|
| |
|
|
|
|
| |
pointers.
llvm-svn: 150690
|
| |
|
|
|
|
| |
don't assume it is a boolean.
llvm-svn: 150247
|
| |
|
|
| |
llvm-svn: 149967
|
| |
|
|
|
|
| |
it to simplify a few matchers.
llvm-svn: 147403
|
| |
|
|
| |
llvm-svn: 145801
|
| |
|
|
|
|
|
| |
InstructionSimplify.cpp. Other fixups as needed.
Part of rdar://10500969
llvm-svn: 145559
|
| |
|
|
| |
llvm-svn: 145556
|
| |
|
|
| |
llvm-svn: 144121
|
| |
|
|
| |
llvm-svn: 143719
|
| |
|
|
|
|
|
|
|
|
|
|
| |
with the given predicate, it matches any condition and returns the
predicate - d'oh! Original commit message:
The expression icmp eq (select (icmp eq x, 0), 1, x), 0 folds to false.
Spotted by my super-optimizer in 186.crafty and 450.soplex. We really
need a proper infrastructure for handling generalizations of this kind
of thing (which occur a lot), however this case is so simple that I decided
to go ahead and implement it directly.
llvm-svn: 143318
|
| |
|
|
| |
llvm-svn: 143265
|
| |
|
|
|
|
|
|
|
| |
Spotted by my super-optimizer in 186.crafty and 450.soplex. We really
need a proper infrastructure for handling generalizations of this kind
of thing (which occur a lot), however this case is so simple that I decided
to go ahead and implement it directly.
llvm-svn: 143214
|
| |
|
|
|
|
| |
in 186.crafty.
llvm-svn: 143209
|
| |
|
|
|
|
|
|
|
|
|
| |
using BinaryOperator (which only works for instructions) when it should have
been a cast to OverflowingBinaryOperator (which also works for constants).
While there, correct a few other dubious looking uses of BinaryOperator.
Thanks to Chad Rosier for the testcase. Original commit message:
My super-optimizer noticed that we weren't folding this expression to
true: (x *nsw x) sgt 0, where x = (y | 1). This occurs in 464.h264ref.
llvm-svn: 143125
|
| |
|
|
|
|
| |
in 403.gcc and was spotted by my super-optimizer.
llvm-svn: 143054
|
| |
|
|
|
|
|
|
| |
original value if types don't match.
Fixes clang selfhost.
llvm-svn: 139120
|
| |
|
|
|
|
| |
up do-nothing exception handling code produced by dragonegg.
llvm-svn: 139113
|
| |
|
|
|
|
| |
is clearly impossible given the current structure of the code.
llvm-svn: 137853
|
| |
|
|
|
|
| |
how to actually trigger the codepath in question at the moment, but it might get exposed in the future.
llvm-svn: 137781
|
| |
|
|
|
|
| |
reported at http://habrahabr.ru/blogs/compilers/125626/.
llvm-svn: 136865
|
| |
|
|
|
|
|
| |
way for i1 and vector of i1 types. Use these to make some code
more self-documenting.
llvm-svn: 136079
|
| |
|
|
| |
llvm-svn: 135904
|
| |
|
|
|
|
| |
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.
llvm-svn: 135673
|
| |
|
|
| |
llvm-svn: 135482
|
| |
|
|
| |
llvm-svn: 135477
|
| |
|
|
| |
llvm-svn: 135375
|
| |
|
|
| |
llvm-svn: 134223
|
| |
|
|
|
|
|
| |
often expressed as "x >= y ? x : y", there is a good chance we can extract
the existing "x >= y" from it and use that as a replacement for "max(x,y)==x".
llvm-svn: 131049
|
| |
|
|
|
|
| |
side of the icmp is an exact shift.
llvm-svn: 130954
|
| |
|
|
|
|
|
|
| |
but according to my super-optimizer there are only two missed simplifications
of -instsimplify kind when compiling bzip2, and this is one of them. It amuses
me to have bzip2 be perfectly optimized as far as instsimplify goes!
llvm-svn: 130840
|
| |
|
|
|
|
|
|
| |
max(a,b) >= a -> true. According to my super-optimizer, these are
by far the most common simplifications (of the -instsimplify kind)
that occur in the testsuite and aren't caught by -std-compile-opts.
llvm-svn: 130780
|
| |
|
|
|
|
| |
a vector compare, generate a vector result rather than i1 (and crashing).
llvm-svn: 130706
|
| |
|
|
|
|
|
| |
This automagically provides a transform noticed by my super-optimizer
as occurring quite often: "rem x, (select cond, x, 1)" -> 0.
llvm-svn: 130694
|
| |
|
|
| |
llvm-svn: 129271
|
| |
|
|
|
|
| |
Thanks Duncan Sands!
llvm-svn: 127323
|
| |
|
|
|
|
|
|
|
| |
gave up when I realized I couldn't come up with a good name for what the
refactored function would be, to describe what it does.
This is PR9343 test12, which is test3 with arguments reordered. Whoops!
llvm-svn: 127318
|
| |
|
|
|
|
|
|
|
| |
possible. This goes into instcombine and instsimplify because instsimplify
doesn't need to check hasOneUse since it returns (almost exclusively) constants.
This fixes PR9343 #4 #5 and #8!
llvm-svn: 127064
|
| |
|
|
| |
llvm-svn: 127021
|
| |
|
|
|
|
|
| |
in the urem case, though not the other way around. This is enough to get #3 from
PR9343!
llvm-svn: 126991
|
| |
|
|
|
|
|
|
|
| |
"icmp pred %X, CI" and a number of examples where "%X = binop %Y, CI2".
Some of these cases (div and rem) used to make it through opt -O2, but the
others are probably now making code elsewhere redundant (probably instcombine).
llvm-svn: 126988
|
| |
|
|
|
|
|
| |
more work to do here, "icmp ult (urem X, 10), 11" doesn't optimize away yet.
Fixes example 3 from PR9343!
llvm-svn: 126741
|
| |
|
|
| |
llvm-svn: 126082
|