summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/ragreedy-bug.ll
diff options
context:
space:
mode:
authorKyle Butt <kyle+llvm@iteratee.net>2016-10-04 23:54:18 +0000
committerKyle Butt <kyle+llvm@iteratee.net>2016-10-04 23:54:18 +0000
commitadabac2d577e0cbca61e6d0ab24098cfc1b3fe6e (patch)
tree988f376cefb60f4be05a3e6ab85583e7d1058587 /llvm/test/CodeGen/X86/ragreedy-bug.ll
parent32986ede316ef75285a05eada870313a9a00c031 (diff)
downloadbcm5719-llvm-adabac2d577e0cbca61e6d0ab24098cfc1b3fe6e.tar.gz
bcm5719-llvm-adabac2d577e0cbca61e6d0ab24098cfc1b3fe6e.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. Issue from previous rollback fixed, and a new test was added for that case as well. Differential revision: https://reviews.llvm.org/D18226 llvm-svn: 283274
Diffstat (limited to 'llvm/test/CodeGen/X86/ragreedy-bug.ll')
-rw-r--r--llvm/test/CodeGen/X86/ragreedy-bug.ll22
1 files changed, 20 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/X86/ragreedy-bug.ll b/llvm/test/CodeGen/X86/ragreedy-bug.ll
index e8426317f13..bfeb041f89a 100644
--- a/llvm/test/CodeGen/X86/ragreedy-bug.ll
+++ b/llvm/test/CodeGen/X86/ragreedy-bug.ll
@@ -3,16 +3,34 @@
; This testing case is reduced from 197.parser prune_match function.
; We make sure register copies are not generated on isupper.exit blocks.
-; CHECK: isupper.exit
+; isupper.exit and isupper.exit223 get tail-duplicated into all their
+; predecessors.
+; CHECK: cond.true.i.i
; CHECK-NEXT: in Loop
+; Mem-move
+; CHECK-NEXT: movl
+; CHECK-NEXT: andl
; CHECK-NEXT: testl
; CHECK-NEXT: jne
-; CHECK: isupper.exit
+; CHECK: cond.true.i.i217
; CHECK-NEXT: in Loop
+; Mem-move
+; CHECK-NEXT: movl
+; CHECK-NEXT: andl
; CHECK-NEXT: testl
; CHECK-NEXT: je
+; CHECK: cond.false.i.i
; CHECK: maskrune
+; CHECK-NEXT: movzbl
+; CHECK-NEXT: movzbl
+; CHECK-NEXT: testl
+; CHECK-NEXT: je
+; CHECK: cond.false.i.i219
; CHECK: maskrune
+; CHECK-NEXT: movzbl
+; CHECK-NEXT: movzbl
+; CHECK-NEXT: testl
+; CHECK-NEXT: jne
%struct.List_o_links_struct = type { i32, i32, i32, %struct.List_o_links_struct* }
%struct.Connector_struct = type { i16, i16, i8, i8, %struct.Connector_struct*, i8* }
OpenPOWER on IntegriCloud