diff options
author | Dale Johannesen <dalej@apple.com> | 2010-06-18 19:00:18 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-06-18 19:00:18 +0000 |
commit | c1570dda5c4fd8792fb159a0ec77ceee6348887a (patch) | |
tree | 896b7cbefa8b205ce5fcf2aa4f0db2ff04f1a105 /llvm/test/CodeGen/Thumb2/thumb2-call-tc.ll | |
parent | e5457c275d0b5594995af70f8bf900c7fe435c26 (diff) | |
download | bcm5719-llvm-c1570dda5c4fd8792fb159a0ec77ceee6348887a.tar.gz bcm5719-llvm-c1570dda5c4fd8792fb159a0ec77ceee6348887a.zip |
Enable tail calls on ARM by default, with some
basic tests.
This has been well tested on Darwin but not elsewhere.
It should work provided the linker correctly resolves
B.W <label in other function>
which it has not seen before, at least from llvm-based
compilers. I'm leaving the arm-tail-calls switch in
until I see if there's any problems because of that;
it might need to be disabled for some environments.
llvm-svn: 106299
Diffstat (limited to 'llvm/test/CodeGen/Thumb2/thumb2-call-tc.ll')
-rw-r--r-- | llvm/test/CodeGen/Thumb2/thumb2-call-tc.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Thumb2/thumb2-call-tc.ll b/llvm/test/CodeGen/Thumb2/thumb2-call-tc.ll new file mode 100644 index 00000000000..d31ae0cc455 --- /dev/null +++ b/llvm/test/CodeGen/Thumb2/thumb2-call-tc.ll @@ -0,0 +1,27 @@ +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s -check-prefix=DARWIN +; RUN: llc < %s -mtriple=thumbv7-linux -mattr=+thumb2 | FileCheck %s -check-prefix=LINUX + +@t = weak global i32 ()* null ; <i32 ()**> [#uses=1] + +declare void @g(i32, i32, i32, i32) + +define void @f() { +; DARWIN: f: +; DARWIN: blx _g + +; LINUX: f: +; LINUX: bl g + call void @g( i32 1, i32 2, i32 3, i32 4 ) + ret void +} + +define void @h() { +; DARWIN: h: +; DARWIN: bx r0 @ TAILCALL + +; LINUX: h: +; LINUX: bx r0 @ TAILCALL + %tmp = load i32 ()** @t ; <i32 ()*> [#uses=1] + %tmp.upgrd.2 = tail call i32 %tmp( ) ; <i32> [#uses=0] + ret void +} |