diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2017-08-19 06:06:44 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2017-08-19 06:06:44 +0000 |
| commit | 2a80fddf6741af67d101f27dc29dc2ea0e838266 (patch) | |
| tree | d96bc80187804522905339ed8b00f111bb20dde7 /llvm | |
| parent | 1f8212597d7d52fe9250ab245c838111a01e73f3 (diff) | |
| download | bcm5719-llvm-2a80fddf6741af67d101f27dc29dc2ea0e838266.tar.gz bcm5719-llvm-2a80fddf6741af67d101f27dc29dc2ea0e838266.zip | |
[Inliner] Clean up a test case a bit to make it more clear what is being
tested and why.
llvm-svn: 311228
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/test/Transforms/Inline/recursive.ll | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/llvm/test/Transforms/Inline/recursive.ll b/llvm/test/Transforms/Inline/recursive.ll index e189339e224..233c81a1798 100644 --- a/llvm/test/Transforms/Inline/recursive.ll +++ b/llvm/test/Transforms/Inline/recursive.ll @@ -1,39 +1,42 @@ +; Inlining in the presence of recursion presents special challenges that we +; test here. +; ; RUN: opt -inline -S < %s | FileCheck %s ; RUN: opt -passes='cgscc(inline)' -S < %s | FileCheck %s -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin10.0" - -; rdar://10853263 - -; Make sure that the callee is still here. -; CHECK-LABEL: define i32 @callee( -define i32 @callee(i32 %param) { +define i32 @large_stack_callee(i32 %param) { +; CHECK-LABEL: define i32 @large_stack_callee( +entry: %yyy = alloca [100000 x i8] %r = bitcast [100000 x i8]* %yyy to i8* - call void @foo2(i8* %r) + call void @bar(i8* %r) ret i32 4 } -; CHECK-LABEL: define i32 @caller( +; Test a recursive function which calls another function with a large stack. In +; addition to not inlining the recursive call, we should also not inline the +; large stack allocation into a potentially recursive frame. +define i32 @large_stack_recursive_caller(i32 %param) { +; CHECK-LABEL: define i32 @large_stack_recursive_caller( +entry: ; CHECK-NEXT: entry: ; CHECK-NOT: alloca -; CHECK: ret -define i32 @caller(i32 %param) { -entry: %t = call i32 @foo(i32 %param) %cmp = icmp eq i32 %t, -1 br i1 %cmp, label %exit, label %cont cont: - %r = call i32 @caller(i32 %t) - %f = call i32 @callee(i32 %r) - br label %cont + %r = call i32 @large_stack_recursive_caller(i32 %t) +; CHECK: call i32 @large_stack_recursive_caller + %f = call i32 @large_stack_callee(i32 %r) +; CHECK: call i32 @large_stack_callee + br label %exit + exit: ret i32 4 } -declare void @foo2(i8* %in) +declare void @bar(i8* %in) declare i32 @foo(i32 %param) |

