| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
then we don't want to set the destination in the indirect branch to the
destination. This is because the indirect branch needs its destinations to have
had their block addresses taken. This isn't so of the new critical edge that's
split during this process. If it turns out that the destination block has only
one predecessor, and that being a BB with an indirect branch, then it won't be
marked as 'used' and may be removed.
PR10072
llvm-svn: 132638
|
| |
|
|
|
|
|
|
| |
to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior.
I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this.
llvm-svn: 131855
|
| |
|
|
| |
llvm-svn: 131673
|
| |
|
|
| |
llvm-svn: 131620
|
| |
|
|
| |
llvm-svn: 131609
|
| |
|
|
| |
llvm-svn: 131607
|
| |
|
|
| |
llvm-svn: 131605
|
| |
|
|
| |
llvm-svn: 131598
|
| |
|
|
| |
llvm-svn: 131580
|
| |
|
|
| |
llvm-svn: 131571
|
| |
|
|
| |
llvm-svn: 131566
|
| |
|
|
| |
llvm-svn: 131561
|
| |
|
|
| |
llvm-svn: 131552
|
| |
|
|
| |
llvm-svn: 131551
|
| |
|
|
| |
llvm-svn: 131548
|
| |
|
|
| |
llvm-svn: 131545
|
| |
|
|
| |
llvm-svn: 131508
|
| |
|
|
| |
llvm-svn: 131345
|
| |
|
|
| |
llvm-svn: 130528
|
| |
|
|
| |
llvm-svn: 130527
|
| |
|
|
|
|
| |
phi node folding
llvm-svn: 130526
|
| |
|
|
|
|
|
|
|
|
|
|
| |
instruction around, reducing work.
Greatly simplify handling of debug instructions. There is no need to
build up a vector of them and then move them into the one predecessor
if we're processing a block. Instead just rescan the block and *copy*
them into the pred. If a block gets merged into multiple preds, this
will retain more debug info.
llvm-svn: 129502
|
| |
|
|
| |
llvm-svn: 129319
|
| |
|
|
| |
llvm-svn: 129114
|
| |
|
|
|
|
| |
match.
llvm-svn: 129078
|
| |
|
|
| |
llvm-svn: 129041
|
| |
|
|
|
|
| |
values also.
llvm-svn: 129035
|
| |
|
|
|
|
| |
PHINode::Create() giving the (known or expected) number of operands.
llvm-svn: 128537
|
| |
|
|
| |
llvm-svn: 128535
|
| |
|
|
|
|
| |
of pointers in an std::map.
llvm-svn: 127650
|
| |
|
|
|
|
|
|
| |
reachable uses, but there still might be uses in dead blocks. Use the
standard solution of replacing all the uses with undef. This is
a rare case because it's very sensitive to phase ordering in SimplifyCFG.
llvm-svn: 127299
|
| |
|
|
|
|
|
|
| |
branch.
Based on a patch by Alistair Lynn.
llvm-svn: 126647
|
| |
|
|
|
|
|
| |
Yes, there are other types than i8* and GEPs on them can produce an add+multiply.
We don't consider that cheap enough to be speculatively executed.
llvm-svn: 126481
|
| |
|
|
| |
llvm-svn: 126452
|
| |
|
|
|
|
| |
unconditionally.
llvm-svn: 126445
|
| |
|
|
|
|
|
|
| |
switch. If we used only one icmp, don't turn it into a switch.
Also prevent the switch-to-icmp transform from creating identity adds, noticed by Marius Wachtler.
llvm-svn: 125056
|
| |
|
|
|
|
|
|
| |
are not sorted into sub+icmp.
This transforms another 1000 switches in gcc.c.
llvm-svn: 124826
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the job of the later optzn passes easier, allowing the vast amount of
icmp transforms to chew on it.
We transform 840 switches in gcc.c, leading to a 16k byte shrink of the resulting
binary on i386-linux.
The testcase from README.txt now compiles into
decl %edi
cmpl $3, %edi
sbbl %eax, %eax
andl $1, %eax
ret
llvm-svn: 124724
|
| |
|
|
| |
llvm-svn: 124526
|
| |
|
|
| |
llvm-svn: 124522
|
| |
|
|
|
|
| |
unconditional predecessor to enable TCE on demand.
llvm-svn: 124518
|
| |
|
|
| |
llvm-svn: 124478
|
| |
|
|
|
|
|
|
| |
branches. PR8575, rdar://5134905, rdar://8911460.
- Allow codegen tail duplication to dup small return blocks after register
allocation is done.
llvm-svn: 124462
|
| |
|
|
|
|
|
|
| |
a new helper function so it can be reused in e.g. an upcoming SimplifySwitchOnSelect.
No functional change.
llvm-svn: 123234
|
| |
|
|
| |
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
|