diff options
| author | Dan Gohman <gohman@apple.com> | 2009-11-12 00:39:10 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-11-12 00:39:10 +0000 |
| commit | 09478e975dd320ec4ca6c0819f1a72ff12becd7a (patch) | |
| tree | 2670be211ac3978ece3627b95f2895e6c6b155cd /llvm/test/CodeGen | |
| parent | a970d39ebfb552890bb8920ff6f4db70e96d4720 (diff) | |
| download | bcm5719-llvm-09478e975dd320ec4ca6c0819f1a72ff12becd7a.tar.gz bcm5719-llvm-09478e975dd320ec4ca6c0819f1a72ff12becd7a.zip | |
Tail merge at any size when there are two potentials blocks and one
can be made to fall through into the other.
llvm-svn: 86909
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/tail-opts.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/tail-opts.ll b/llvm/test/CodeGen/X86/tail-opts.ll index 79825b7fd59..fdf96d60866 100644 --- a/llvm/test/CodeGen/X86/tail-opts.ll +++ b/llvm/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() |

