| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
InstructionSimplify.cpp. Other fixups as needed.
Part of rdar://10500969
llvm-svn: 145559
|
|
|
|
| |
llvm-svn: 140821
|
|
|
|
|
|
|
|
| |
to be uniqued, without any benefit.
If someone prefers %tmp42 to %42, run instnamer.
llvm-svn: 140634
|
|
|
|
| |
llvm-svn: 139156
|
|
|
|
|
|
| |
and b) doing a separate pass over dbg.value instructions.
llvm-svn: 137908
|
|
|
|
|
|
| |
check for a LandingPadInst.
llvm-svn: 137745
|
|
|
|
|
|
| |
if necessary.
llvm-svn: 137679
|
|
|
|
| |
llvm-svn: 137626
|
|
|
|
| |
llvm-svn: 135375
|
|
|
|
| |
llvm-svn: 132285
|
|
|
|
|
|
| |
code in one place. Re-apply 131534 and fix the multi-step promotion of integers.
llvm-svn: 132217
|
|
|
|
|
|
|
|
| |
This looks like it flagged an actual bug. Devang, please review. I added
the parentheses that change behavior, but make the behavior more closely
match commit log's intent.
llvm-svn: 132165
|
|
|
|
| |
llvm-svn: 132164
|
|
|
|
| |
llvm-svn: 132161
|
|
|
|
|
|
| |
iSel may not be able to find corresponding Node for llvm.dbg.value during DAG construction. Make iSel's life easier by removing this distance between llvm.dbg.value and its value instruction.
llvm-svn: 132151
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Original log entry:
Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place.
llvm-svn: 131536
|
|
|
|
|
|
| |
code in one place.
llvm-svn: 131534
|
|
|
|
|
|
|
| |
delete the instruction pointed to by CGP's current instruction
iterator, leading to a crash on the testcase. This fixes PR9578.
llvm-svn: 129200
|
|
|
|
|
|
| |
affect the generated code.
llvm-svn: 128217
|
|
|
|
|
|
| |
void; it doesn't need to have a void type.
llvm-svn: 128212
|
|
|
|
| |
llvm-svn: 128211
|
|
|
|
|
|
| |
void return type. This fixes PR9487.
llvm-svn: 128197
|
|
|
|
| |
llvm-svn: 128196
|
|
|
|
|
|
| |
use it later. I couldn't make a test that hits this with the current code.
llvm-svn: 128195
|
|
|
|
| |
llvm-svn: 128194
|
|
|
|
|
|
| |
predecessors; update dominator tree if cfg is modified.
llvm-svn: 127981
|
|
|
|
|
|
| |
to canonicalize IR", it broke a lot of things.
llvm-svn: 127954
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to have single return block (at least getting there) for optimizations. This
is general goodness but it would prevent some tailcall optimizations.
One specific case is code like this:
int f1(void);
int f2(void);
int f3(void);
int f4(void);
int f5(void);
int f6(void);
int foo(int x) {
switch(x) {
case 1: return f1();
case 2: return f2();
case 3: return f3();
case 4: return f4();
case 5: return f5();
case 6: return f6();
}
}
=>
LBB0_2: ## %sw.bb
callq _f1
popq %rbp
ret
LBB0_3: ## %sw.bb1
callq _f2
popq %rbp
ret
LBB0_4: ## %sw.bb3
callq _f3
popq %rbp
ret
This patch teaches codegenprep to duplicate returns when the return value
is a phi and where the phi operands are produced by tail calls followed by
an unconditional branch:
sw.bb7: ; preds = %entry
%call8 = tail call i32 @f5() nounwind
br label %return
sw.bb9: ; preds = %entry
%call10 = tail call i32 @f6() nounwind
br label %return
return:
%retval.0 = phi i32 [ %call10, %sw.bb9 ], [ %call8, %sw.bb7 ], ... [ 0, %entry ]
ret i32 %retval.0
This allows codegen to generate better code like this:
LBB0_2: ## %sw.bb
jmp _f1 ## TAILCALL
LBB0_3: ## %sw.bb1
jmp _f2 ## TAILCALL
LBB0_4: ## %sw.bb3
jmp _f3 ## TAILCALL
rdar://9147433
llvm-svn: 127953
|
|
|
|
|
|
|
|
|
|
|
| |
Optimize trivial branches in CodeGenPrepare, which often get created from the
lowering of objectsize intrinsics. Unfortunately, a number of tests were relying
on llc not optimizing trivial branches, so I had to add an option to allow them
to continue to test what they originally tested.
This fixes <rdar://problem/8785296> and <rdar://problem/9112893>.
llvm-svn: 127498
|
|
|
|
|
|
| |
created from the", it broke some GCC test suite tests.
llvm-svn: 127477
|
|
|
|
|
|
|
|
|
|
| |
lowering of objectsize intrinsics. Unfortunately, a number of tests were relying
on llc not optimizing trivial branches, so I had to add an option to allow them
to continue to test what they originally tested.
This fixes <rdar://problem/8785296> and <rdar://problem/9112893>.
llvm-svn: 127459
|
|
|
|
|
|
|
| |
the percentage of time spent in CodeGenPrepare when llcing 403.gcc from 12.6% to
1.8% of total llc time.
llvm-svn: 127069
|
|
|
|
| |
llvm-svn: 126826
|
|
|
|
| |
llvm-svn: 126825
|
|
|
|
|
|
|
|
| |
addressing code. On 403.gcc this almost halves CodeGenPrepare time and reduces
total llc time by 9.5%. Unfortunately, getNumUses() is still the hottest function
in llc.
llvm-svn: 126782
|
|
|
|
|
|
| |
llvm.objectsize changes.
llvm-svn: 123771
|
|
|
|
|
|
| |
realize that ConstantFoldTerminator doesn't preserve dominfo.
llvm-svn: 123527
|
|
|
|
|
|
|
|
|
| |
The basic issue is that isel (very reasonably!) expects conditional branches
to be folded, so CGP leaving around a bunch dead computation feeding
conditional branches isn't such a good idea. Just fold branches on constants
into unconditional branches.
llvm-svn: 123526
|
|
|
|
| |
llvm-svn: 123525
|
|
|
|
|
|
|
|
| |
have objectsize folding recursively simplify away their result when it
folds. It is important to catch this here, because otherwise we won't
eliminate the cross-block values at isel and other times.
llvm-svn: 123524
|
|
|
|
|
|
|
| |
potentially invalidate it (like inline asm lowering) to be sunk into
their proper place, cleaning up a ton of code.
llvm-svn: 123523
|
|
|
|
|
|
|
|
|
|
| |
they all ready do). This removes two dominator recomputations prior to isel,
which is a 1% improvement in total llc time for 403.gcc.
The only potentially suspect thing is making GCStrategy recompute dominators if
it used a custom lowering strategy.
llvm-svn: 123064
|
|
|
|
|
|
| |
OptimizeInst() so that they can be used on a worklist instruction.
llvm-svn: 122945
|
|
|
|
| |
llvm-svn: 122944
|
|
|
|
|
|
|
| |
into a separate function, so that it can be called from a loop using a worklist
rather than a loop traversing a whole basic block.
llvm-svn: 122943
|
|
|
|
|
|
| |
worklist, the key will need to become std::pair<BasicBlock*, Value*>.
llvm-svn: 122932
|
|
|
|
| |
llvm-svn: 122891
|
|
|
|
|
|
| |
regressing code quality.
llvm-svn: 122887
|
|
|
|
|
|
| |
CodeGenPrepare (which is the default behavior).
llvm-svn: 122801
|