diff options
-rw-r--r-- | test/Transforms/Inline/2008-09-02-AlwaysInline.ll | 10 | ||||
-rw-r--r-- | test/Transforms/Inline/2008-10-30-AlwaysInline.ll | 14 | ||||
-rw-r--r-- | test/Transforms/Inline/2008-11-04-AlwaysInline.ll | 7 | ||||
-rw-r--r-- | test/Transforms/Inline/always-inline.ll | 42 | ||||
-rw-r--r-- | test/Transforms/Inline/always_inline_dyn_alloca.ll | 15 |
5 files changed, 42 insertions, 46 deletions
diff --git a/test/Transforms/Inline/2008-09-02-AlwaysInline.ll b/test/Transforms/Inline/2008-09-02-AlwaysInline.ll deleted file mode 100644 index 39095c4..0000000 --- a/test/Transforms/Inline/2008-09-02-AlwaysInline.ll +++ /dev/null @@ -1,10 +0,0 @@ -; RUN: opt < %s -inline-threshold=0 -inline -S | not grep call - -define i32 @fn2() alwaysinline { - ret i32 1 -} - -define i32 @fn3() { - %r = call i32 @fn2() - ret i32 %r -} diff --git a/test/Transforms/Inline/2008-10-30-AlwaysInline.ll b/test/Transforms/Inline/2008-10-30-AlwaysInline.ll deleted file mode 100644 index 11e5012..0000000 --- a/test/Transforms/Inline/2008-10-30-AlwaysInline.ll +++ /dev/null @@ -1,14 +0,0 @@ -; RUN: opt < %s -always-inline -S | not grep call - -; Ensure that threshold doesn't disrupt always inline. -; RUN: opt < %s -inline-threshold=-2000000001 -always-inline -S | not grep call - - -define internal i32 @if0() alwaysinline { - ret i32 1 -} - -define i32 @f0() { - %r = call i32 @if0() - ret i32 %r -} diff --git a/test/Transforms/Inline/2008-11-04-AlwaysInline.ll b/test/Transforms/Inline/2008-11-04-AlwaysInline.ll deleted file mode 100644 index bc9787b..0000000 --- a/test/Transforms/Inline/2008-11-04-AlwaysInline.ll +++ /dev/null @@ -1,7 +0,0 @@ -; RUN: opt < %s -always-inline -S | grep {@foo} -; Ensure that foo is not removed by always inliner -; PR 2945 - -define internal i32 @foo() nounwind { - ret i32 0 -} diff --git a/test/Transforms/Inline/always-inline.ll b/test/Transforms/Inline/always-inline.ll new file mode 100644 index 0000000..40091d7 --- /dev/null +++ b/test/Transforms/Inline/always-inline.ll @@ -0,0 +1,42 @@ +; RUN: opt < %s -inline-threshold=0 -always-inline -S | FileCheck %s +; +; Ensure the threshold has no impact on these decisions. +; RUN: opt < %s -inline-threshold=20000000 -always-inline -S | FileCheck %s +; RUN: opt < %s -inline-threshold=-20000000 -always-inline -S | FileCheck %s + +define i32 @inner1() alwaysinline { + ret i32 1 +} +define i32 @outer1() { +; CHECK: @outer1 +; CHECK-NOT: call +; CHECK: ret + + %r = call i32 @inner1() + ret i32 %r +} + +; The always inliner can't DCE internal functions. PR2945 +; CHECK: @pr2945 +define internal i32 @pr2945() nounwind { + ret i32 0 +} + +define internal void @inner2(i32 %N) alwaysinline { + %P = alloca i32, i32 %N + ret void +} +define void @outer2(i32 %N) { +; The always inliner (unlike the normal one) should be willing to inline +; a function with a dynamic alloca into one without a dynamic alloca. +; rdar://6655932 +; +; CHECK: @outer2 +; CHECK-NOT: call void @inner2 +; CHECK alloca i32, i32 %N +; CHECK-NOT: call void @inner2 +; CHECK: ret void + + call void @inner2( i32 %N ) + ret void +} diff --git a/test/Transforms/Inline/always_inline_dyn_alloca.ll b/test/Transforms/Inline/always_inline_dyn_alloca.ll deleted file mode 100644 index 25cfc49..0000000 --- a/test/Transforms/Inline/always_inline_dyn_alloca.ll +++ /dev/null @@ -1,15 +0,0 @@ -; RUN: opt < %s -inline -S | not grep callee -; rdar://6655932 - -; If callee is marked alwaysinline, inline it! Even if callee has dynamic -; alloca and caller does not, - -define internal void @callee(i32 %N) alwaysinline { - %P = alloca i32, i32 %N - ret void -} - -define void @foo(i32 %N) { - call void @callee( i32 %N ) - ret void -} |