mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 16:56:50 +00:00
90365ceb11
Summary: The tail call optimisation is performed before register allocation, so at that point we don't know if LR is being spilt or not. If LR was spilt to the stack, then we cannot do a tail call optimisation. That would involve popping back into LR which is not possible in Thumb1 code. Reviewers: rengolin, jmolloy, rovka, olista01 Reviewed By: olista01 Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D29020 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294000 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
386 B
LLVM
24 lines
386 B
LLVM
; RUN: llc %s -o - -mtriple=thumbv8m.base | FileCheck %s
|
|
|
|
define void @test() {
|
|
; CHECK-LABEL: test:
|
|
entry:
|
|
%call = tail call i32 @foo()
|
|
%tail = tail call i32 @foo()
|
|
ret void
|
|
; CHECK: bl foo
|
|
; CHECK: bl foo
|
|
; CHECK-NOT: b foo
|
|
}
|
|
|
|
define void @test2() {
|
|
; CHECK-LABEL: test2:
|
|
entry:
|
|
%tail = tail call i32 @foo()
|
|
ret void
|
|
; CHECK: b foo
|
|
; CHECK-NOT: bl foo
|
|
}
|
|
|
|
declare i32 @foo()
|