| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
InstructionSimplify on instructions that didn't change since the
last time round the loop.
llvm-svn: 122745
|
|
|
|
|
|
| |
so that Dominators.h is *just* domtree. Also prune #includes a bit.
llvm-svn: 122714
|
|
|
|
|
|
|
|
|
|
| |
described
in the PR, the pass could break LCSSA form when inserting preheaders. It probably
would be easy enough to fix this, but since currently we always go into LCSSA form
after running this pass, doing so is not urgent.
llvm-svn: 122695
|
|
|
|
|
|
| |
operands are visited before the instructions themselves.
llvm-svn: 122647
|
|
|
|
| |
llvm-svn: 122645
|
|
|
|
| |
llvm-svn: 122642
|
|
|
|
|
|
| |
and superseded by IRBuilder.
llvm-svn: 122576
|
|
|
|
| |
llvm-svn: 122556
|
|
|
|
|
|
|
| |
getOrEnforceKnownAlignment function, which simplifies the code
and makes it stronger.
llvm-svn: 122555
|
|
|
|
| |
llvm-svn: 122554
|
|
|
|
|
|
|
| |
new gcc warning that complains on self-assignments and
self-initializations.
llvm-svn: 122458
|
|
|
|
|
|
|
| |
visit instructions before their uses, since InstructionSimplify does a
better job in that case. All this prompted by Frits van Bommel.
llvm-svn: 122343
|
|
|
|
|
|
|
| |
not very important since the pass is only used for testing, but it does make
it more realistic. Suggested by Frits van Bommel.
llvm-svn: 122336
|
|
|
|
| |
llvm-svn: 122265
|
|
|
|
|
|
|
|
|
| |
it could only be tested indirectly, via instcombine, gvn or some other
pass that makes use of InstructionSimplify, which means that testcases
had to be carefully contrived to dance around any other transformations
that that pass did.
llvm-svn: 122264
|
|
|
|
|
|
| |
to make sure that the reused alloca has sufficient alignment.
llvm-svn: 122236
|
|
|
|
| |
llvm-svn: 122235
|
|
|
|
|
|
|
|
| |
argument. The generated alloca has to have at least the alignment of the
byval, if not, the client may be making assumptions that the new alloca won't
satisfy.
llvm-svn: 122234
|
|
|
|
| |
llvm-svn: 122156
|
|
|
|
| |
llvm-svn: 122054
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
comparisons formed by comparisons. For example,
this:
void foo(unsigned x) {
if (x == 0 || x == 1 || x == 3 || x == 4 || x == 6)
bar();
}
compiles into:
_foo: ## @foo
## BB#0: ## %entry
cmpl $6, %edi
ja LBB0_2
## BB#1: ## %entry
movl %edi, %eax
movl $91, %ecx
btq %rax, %rcx
jb LBB0_3
instead of:
_foo: ## @foo
## BB#0: ## %entry
cmpl $2, %edi
jb LBB0_4
## BB#1: ## %switch.early.test
cmpl $6, %edi
ja LBB0_3
## BB#2: ## %switch.early.test
movl %edi, %eax
movl $88, %ecx
btq %rax, %rcx
jb LBB0_4
This catches a bunch of cases in GCC, which look like this:
%804 = load i32* @which_alternative, align 4, !tbaa !0
%805 = icmp ult i32 %804, 2
%806 = icmp eq i32 %804, 3
%or.cond121 = or i1 %805, %806
%807 = icmp eq i32 %804, 4
%or.cond124 = or i1 %or.cond121, %807
br i1 %or.cond124, label %.thread, label %808
turning this into a range comparison.
llvm-svn: 122045
|
|
|
|
| |
llvm-svn: 121838
|
|
|
|
|
|
|
|
|
|
| |
which is simpler than finding a place to insert in BB.
- Don't perform the 'if condition hoisting' xform on certain
i1 PHIs, as it interferes with switch formation.
This re-fixes "example 7", without breaking the world hopefully.
llvm-svn: 121764
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
first, it can kick in on blocks whose conditions have been
folded to a constant, even though one of the edges will be
trivially folded.
second, it doesn't clean up the "if diamond" that it just
eliminated away. This is a problem because other simplifycfg
xforms kick in depending on the order of block visitation,
causing pointless work.
llvm-svn: 121762
|
|
|
|
|
|
| |
breaking the selfhost builds, though I can't fathom how.
llvm-svn: 121761
|
|
|
|
|
|
| |
when all 2-entry phis are simplified away.
llvm-svn: 121760
|
|
|
|
|
|
| |
don't print it unless the xform happens.
llvm-svn: 121758
|
|
|
|
| |
llvm-svn: 121757
|
|
|
|
| |
llvm-svn: 121756
|
|
|
|
| |
llvm-svn: 121755
|
|
|
|
|
|
|
| |
GetIfCondition faster by avoiding pred_iterator. No
really interesting change.
llvm-svn: 121754
|
|
|
|
| |
llvm-svn: 121753
|
|
|
|
|
|
| |
code a bit, switch from constant folding to instsimplify.
llvm-svn: 121751
|
|
|
|
|
|
| |
work, but fixes 400.perlbmk.
llvm-svn: 121749
|
|
|
|
|
|
|
|
| |
r121694, the most recent state
where I'm confident there were no crashes or miscompilations. XFAIL the test added since then for now.
llvm-svn: 121733
|
|
|
|
|
|
| |
invalidation issue, causing a crash on some versions of perlbmk.
llvm-svn: 121728
|
|
|
|
| |
llvm-svn: 121711
|
|
|
|
|
|
| |
Fixes PR 8780.
llvm-svn: 121705
|
|
|
|
|
|
| |
'and' case.
llvm-svn: 121695
|
|
|
|
|
|
|
| |
I can track down a miscompile. This should bring the buildbots
back to life
llvm-svn: 121693
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when simplifying, allowing them to be eagerly turned into switches. This
is the last step required to get "Example 7" from this blog post:
http://blog.regehr.org/archives/320
On X86, we now generate this machine code, which (to my eye) seems better
than the ICC generated code:
_crud: ## @crud
## BB#0: ## %entry
cmpb $33, %dil
jb LBB0_4
## BB#1: ## %switch.early.test
addb $-34, %dil
cmpb $58, %dil
ja LBB0_3
## BB#2: ## %switch.early.test
movzbl %dil, %eax
movabsq $288230376537592865, %rcx ## imm = 0x400000017001421
btq %rax, %rcx
jb LBB0_4
LBB0_3: ## %lor.rhs
xorl %eax, %eax
ret
LBB0_4: ## %lor.end
movl $1, %eax
ret
llvm-svn: 121690
|
|
|
|
| |
llvm-svn: 121689
|
|
|
|
|
|
| |
per terminator kind.
llvm-svn: 121688
|
|
|
|
| |
llvm-svn: 121687
|
|
|
|
|
|
|
|
| |
code instead of
doing a cfg search for every block simplified.
llvm-svn: 121686
|
|
|
|
| |
llvm-svn: 121685
|
|
|
|
| |
llvm-svn: 121684
|
|
|
|
|
|
| |
getSinglePredecessor to simplify code.
llvm-svn: 121683
|
|
|
|
| |
llvm-svn: 121681
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'or sequence' that it doesn't understand. This allows us to optimize
something insane like this:
int crud (unsigned char c, unsigned x)
{
if(((((((((( (int) c <= 32 ||
(int) c == 46) || (int) c == 44)
|| (int) c == 58) || (int) c == 59) || (int) c == 60)
|| (int) c == 62) || (int) c == 34) || (int) c == 92)
|| (int) c == 39) != 0)
foo();
}
into:
define i32 @crud(i8 zeroext %c, i32 %x) nounwind ssp noredzone {
entry:
%cmp = icmp ult i8 %c, 33
br i1 %cmp, label %if.then, label %switch.early.test
switch.early.test: ; preds = %entry
switch i8 %c, label %if.end [
i8 39, label %if.then
i8 44, label %if.then
i8 58, label %if.then
i8 59, label %if.then
i8 60, label %if.then
i8 62, label %if.then
i8 46, label %if.then
i8 92, label %if.then
i8 34, label %if.then
]
by pulling the < comparison out ahead of the newly formed switch.
llvm-svn: 121680
|