From 55afd2564c564b8adfd94e7735ce262f621e642b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 2 Feb 2010 02:22:50 +0000 Subject: Perform sibcall in some cases when arguments are passes memory. Look for cases where callee's arguments are already in the caller's own caller's stack and they line up perfectly. e.g. extern int foo(int a, int b, int c); int bar(int a, int b, int c) { return foo(a, b, c); } llvm-svn: 95053 --- llvm/test/CodeGen/X86/tailcall2.ll | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/test') diff --git a/llvm/test/CodeGen/X86/tailcall2.ll b/llvm/test/CodeGen/X86/tailcall2.ll index 1e288f57651..e41e3da4f80 100644 --- a/llvm/test/CodeGen/X86/tailcall2.ll +++ b/llvm/test/CodeGen/X86/tailcall2.ll @@ -89,3 +89,16 @@ bb1: } declare i32 @bar(i32) + +define i32 @t7(i32 %a, i32 %b, i32 %c) nounwind ssp { +entry: +; 32: t7: +; 32: jmp {{_?}}bar2 + +; 64: t7: +; 64: jmp {{_?}}bar2 + %0 = tail call i32 @bar2(i32 %a, i32 %b, i32 %c) nounwind + ret i32 %0 +} + +declare i32 @bar2(i32, i32, i32) -- cgit v1.2.3