[llvm-commits] [llvm] r153831 - in /llvm/trunk/test/Transforms/Inline: 2008-09-02-AlwaysInline.ll 2008-10-30-AlwaysInline.ll 2008-11-04-AlwaysInline.ll always-inline.ll always_inline_dyn_alloca.ll

Chandler Carruth chandlerc at gmail.com
Sun Apr 1 03:11:17 PDT 2012


Author: chandlerc
Date: Sun Apr  1 05:11:17 2012
New Revision: 153831

URL: http://llvm.org/viewvc/llvm-project?rev=153831&view=rev
Log:
Replace four tiny tests with various uses of grep and not with a single
test and FileCheck.

Added:
    llvm/trunk/test/Transforms/Inline/always-inline.ll
Removed:
    llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll
    llvm/trunk/test/Transforms/Inline/2008-10-30-AlwaysInline.ll
    llvm/trunk/test/Transforms/Inline/2008-11-04-AlwaysInline.ll
    llvm/trunk/test/Transforms/Inline/always_inline_dyn_alloca.ll

Removed: llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll?rev=153830&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll (original)
+++ llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll (removed)
@@ -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
-}

Removed: llvm/trunk/test/Transforms/Inline/2008-10-30-AlwaysInline.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2008-10-30-AlwaysInline.ll?rev=153830&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/Inline/2008-10-30-AlwaysInline.ll (original)
+++ llvm/trunk/test/Transforms/Inline/2008-10-30-AlwaysInline.ll (removed)
@@ -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
-}

Removed: llvm/trunk/test/Transforms/Inline/2008-11-04-AlwaysInline.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2008-11-04-AlwaysInline.ll?rev=153830&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/Inline/2008-11-04-AlwaysInline.ll (original)
+++ llvm/trunk/test/Transforms/Inline/2008-11-04-AlwaysInline.ll (removed)
@@ -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
-}

Added: llvm/trunk/test/Transforms/Inline/always-inline.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/always-inline.ll?rev=153831&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/Inline/always-inline.ll (added)
+++ llvm/trunk/test/Transforms/Inline/always-inline.ll Sun Apr  1 05:11:17 2012
@@ -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
+}

Removed: llvm/trunk/test/Transforms/Inline/always_inline_dyn_alloca.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/always_inline_dyn_alloca.ll?rev=153830&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/Inline/always_inline_dyn_alloca.ll (original)
+++ llvm/trunk/test/Transforms/Inline/always_inline_dyn_alloca.ll (removed)
@@ -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
-}





More information about the llvm-commits mailing list