diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-22 23:37:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-22 23:37:35 +0000 |
commit | fe9af3b1f7e5d68ecc330bdf4f047d76838f8cc3 (patch) | |
tree | d106def385fa1eec7fe9778021359c2f1987cf0b /test/Transforms/Inline | |
parent | 3a1287b470bde29d10e7c6998fb69b74d2265b6c (diff) | |
download | llvm-fe9af3b1f7e5d68ecc330bdf4f047d76838f8cc3.tar.gz llvm-fe9af3b1f7e5d68ecc330bdf4f047d76838f8cc3.tar.bz2 llvm-fe9af3b1f7e5d68ecc330bdf4f047d76838f8cc3.tar.xz |
The inliner was choosing to not consider call sites
that appear in the SCC as a result of inlining as candidates
for inlining. Change this so that it *does* consider call
sites that change from being indirect to being direct as a
result of inlining. This allows it to completely
"devirtualize" the testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/Inline')
-rw-r--r-- | test/Transforms/Inline/indirect_resolve.ll | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/test/Transforms/Inline/indirect_resolve.ll b/test/Transforms/Inline/indirect_resolve.ll index 76182e2fe4..eb4f9bc058 100644 --- a/test/Transforms/Inline/indirect_resolve.ll +++ b/test/Transforms/Inline/indirect_resolve.ll @@ -1,7 +1,7 @@ -; RUN: opt < %s -inline | llvm-dis +; RUN: opt < %s -inline -S | FileCheck %s ; PR4834 -define i32 @main() { +define i32 @test1() { %funcall1_ = call fastcc i32 ()* ()* @f1() %executecommandptr1_ = call i32 %funcall1_() ret i32 %executecommandptr1_ @@ -14,3 +14,31 @@ define internal fastcc i32 ()* @f1() nounwind readnone { define internal i32 @f2() nounwind readnone { ret i32 1 } + +; CHECK: @test1() +; CHECK-NEXT: ret i32 1 + + + + + +declare i8* @f1a(i8*) ssp align 2 + +define internal i32 @f2a(i8* %t) inlinehint ssp { +entry: + ret i32 41 +} + +define internal i32 @f3a(i32 (i8*)* %__f) ssp { +entry: + %A = call i32 %__f(i8* undef) + ret i32 %A +} + +define i32 @test2(i8* %this) ssp align 2 { + %X = call i32 @f3a(i32 (i8*)* @f2a) ssp + ret i32 %X +} + +; CHECK: @test2 +; CHECK-NEXT: ret i32 41
\ No newline at end of file |