summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/block-placement.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-23 10:35:36 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-23 10:35:36 +0000
commit598894ff2547aaa0a32ded145063f3bfe042f620 (patch)
tree540dd1661cb5e91748ee4197d3a1d35d14bbcd8e /test/CodeGen/X86/block-placement.ll
parent52a35a89e6c07d010d7abdba9646a56536331c36 (diff)
downloadllvm-598894ff2547aaa0a32ded145063f3bfe042f620.tar.gz
llvm-598894ff2547aaa0a32ded145063f3bfe042f620.tar.bz2
llvm-598894ff2547aaa0a32ded145063f3bfe042f620.tar.xz
Relax an invariant that block placement was trying to assert a bit
further. This invariant just wasn't going to work in the face of unanalyzable branches; we need to be resillient to the phenomenon of chains poking into a loop and poking out of a loop. In fact, we already were, we just needed to not assert on it. This was found during a bootstrap with block placement turned on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/block-placement.ll')
-rw-r--r--test/CodeGen/X86/block-placement.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/X86/block-placement.ll b/test/CodeGen/X86/block-placement.ll
index c03b03ed02..782e154251 100644
--- a/test/CodeGen/X86/block-placement.ll
+++ b/test/CodeGen/X86/block-placement.ll
@@ -568,3 +568,28 @@ loop3:
%next.phi = phi i32* [ %next.load, %loop2b ], [ %next.var, %loop2a ]
br label %loop1
}
+
+define void @unanalyzable_branch_to_loop_header() {
+; Ensure that we can handle unanalyzable branches into loop headers. We
+; pre-form chains for unanalyzable branches, and will find the tail end of that
+; at the start of the loop. This function uses floating point comparison
+; fallthrough because that happens to always produce unanalyzable branches on
+; x86.
+;
+; CHECK: unanalyzable_branch_to_loop_header
+; CHECK: %entry
+; CHECK: %loop
+; CHECK: %exit
+
+entry:
+ %cmp = fcmp une double 0.000000e+00, undef
+ br i1 %cmp, label %loop, label %exit
+
+loop:
+ %cond = icmp eq i8 undef, 42
+ br i1 %cond, label %exit, label %loop
+
+exit:
+ ret void
+}
+