aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-20 09:30:40 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-20 09:30:40 +0000
commit2901243fda3fa68f55f52700d473642e719aa219 (patch)
treeca59a05fcc295dc707a5edb421fcb4168952ec6f /test
parent0d86d462f8458b803d5209a77961dc63d5a9dae0 (diff)
downloadexternal_llvm-2901243fda3fa68f55f52700d473642e719aa219.zip
external_llvm-2901243fda3fa68f55f52700d473642e719aa219.tar.gz
external_llvm-2901243fda3fa68f55f52700d473642e719aa219.tar.bz2
Add some comments to the latest test case I added here to document what
is actually being tested. Also add some FileCheck goodness to much more carefully ensure that the result is the desired result. Before this test would only have failed through an assert failure if the underlying fix were reverted. Also, add some weight metadata and a comment explaining exactly what is going on to a trick section of the test case. Originally, we were getting very unlucky and trying to form a block chain that isn't actually profitable. I'm working on a fix to avoid forming these unprofitable chains, and that would also have masked any failure from this test case. The easy solution is to add some metadata that makes it *really* profitable to form the bad chain here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/block-placement.ll23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/CodeGen/X86/block-placement.ll b/test/CodeGen/X86/block-placement.ll
index 859a702..16e98ed 100644
--- a/test/CodeGen/X86/block-placement.ll
+++ b/test/CodeGen/X86/block-placement.ll
@@ -395,8 +395,27 @@ exit:
}
define void @fpcmp_unanalyzable_branch(i1 %cond) {
+; This function's CFG contains an unanalyzable branch that is likely to be
+; split due to having a different high-probability predecessor.
+; CHECK: fpcmp_unanalyzable_branch
+; CHECK: %entry
+; CHECK: %exit
+; CHECK-NOT: %if.then
+; CHECK-NOT: %if.end
+; CHECK-NOT: jne
+; CHECK-NOT: jnp
+; CHECK: jne
+; CHECK-NEXT: jnp
+; CHECK-NEXT: %if.then
+
entry:
- br i1 %cond, label %entry.if.then_crit_edge, label %lor.lhs.false
+; Note that this branch must be strongly biased toward
+; 'entry.if.then_crit_edge' to ensure that we would try to form a chain for
+; 'entry' -> 'entry.if.then_crit_edge' -> 'if.then'. It is the last edge in that
+; chain which would violate the unanalyzable branch in 'exit', but we won't even
+; try this trick unless 'if.then' is believed to almost always be reached from
+; 'entry.if.then_crit_edge'.
+ br i1 %cond, label %entry.if.then_crit_edge, label %lor.lhs.false, !prof !1
entry.if.then_crit_edge:
%.pre14 = load i8* undef, align 1, !tbaa !0
@@ -418,3 +437,5 @@ if.then:
if.end:
ret void
}
+
+!1 = metadata !{metadata !"branch_weights", i32 1000, i32 1}