diff options
author | Kyle Butt <kyle+llvm@iteratee.net> | 2016-10-04 00:00:09 +0000 |
---|---|---|
committer | Kyle Butt <kyle+llvm@iteratee.net> | 2016-10-04 00:00:09 +0000 |
commit | 396bfdd7076325be148e1e95c433b78849c1083d (patch) | |
tree | 0728afd074400877d223036b746cd4bc265ff8fd /llvm/test/CodeGen/X86/cmov-into-branch.ll | |
parent | da68203678e198ef806b40ac23e4375733097592 (diff) | |
download | bcm5719-llvm-396bfdd7076325be148e1e95c433b78849c1083d.tar.gz bcm5719-llvm-396bfdd7076325be148e1e95c433b78849c1083d.zip |
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.
In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.
This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.
llvm-svn: 283164
Diffstat (limited to 'llvm/test/CodeGen/X86/cmov-into-branch.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/cmov-into-branch.ll | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/cmov-into-branch.ll b/llvm/test/CodeGen/X86/cmov-into-branch.ll index c0c6fc4ac22..6e4762b2e79 100644 --- a/llvm/test/CodeGen/X86/cmov-into-branch.ll +++ b/llvm/test/CodeGen/X86/cmov-into-branch.ll @@ -105,9 +105,11 @@ define i32 @weighted_select3(i32 %a, i32 %b) { ; CHECK-NEXT: testl %edi, %edi ; CHECK-NEXT: je [[LABEL_BB6:.*]] ; CHECK: movl %edi, %eax +; CHECK-NEXT: retq ; CHECK: [[LABEL_BB6]] ; CHECK-NEXT: movl %esi, %edi -; CHECK-NEXT: jmp +; CHECK-NEXT: movl %edi, %eax +; CHECK-NEXT: retq ; %cmp = icmp ne i32 %a, 0 %sel = select i1 %cmp, i32 %a, i32 %b, !prof !2 |