summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/tail-opts.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-12 00:39:10 +0000
committerDan Gohman <gohman@apple.com>2009-11-12 00:39:10 +0000
commitad6af45dc172fe23801771200eabb6a7f764e2cb (patch)
tree06b6558d66a6e6fb871e5ea6493e7e46901a6b13 /test/CodeGen/X86/tail-opts.ll
parent73b55510585573cd37fca85864c8d7d73e6b4093 (diff)
downloadllvm-ad6af45dc172fe23801771200eabb6a7f764e2cb.tar.gz
llvm-ad6af45dc172fe23801771200eabb6a7f764e2cb.tar.bz2
llvm-ad6af45dc172fe23801771200eabb6a7f764e2cb.tar.xz
Tail merge at any size when there are two potentials blocks and one
can be made to fall through into the other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/tail-opts.ll')
-rw-r--r--test/CodeGen/X86/tail-opts.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/X86/tail-opts.ll b/test/CodeGen/X86/tail-opts.ll
index 79825b7fd5..fdf96d6086 100644
--- a/test/CodeGen/X86/tail-opts.ll
+++ b/test/CodeGen/X86/tail-opts.ll
@@ -266,3 +266,30 @@ bb3: ; preds = %bb2, %bb1, %lvalue_
declare fastcc i32 @lvalue_p(%union.tree_node* nocapture) nounwind readonly
declare fastcc %union.tree_node* @default_conversion(%union.tree_node*) nounwind
+
+
+; If one tail merging candidate falls through into the other,
+; tail merging is likely profitable regardless of how few
+; instructions are involved. This function should have only
+; one ret instruction.
+
+; CHECK: foo:
+; CHECK: call func
+; CHECK-NEXT: .LBB5_2:
+; CHECK-NEXT: addq $8, %rsp
+; CHECK-NEXT: ret
+
+define void @foo(i1* %V) nounwind {
+entry:
+ %t0 = icmp eq i1* %V, null
+ br i1 %t0, label %return, label %bb
+
+bb:
+ call void @func()
+ ret void
+
+return:
+ ret void
+}
+
+declare void @func()