mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-15 07:59:57 +00:00
710c1a449d
This is similar to the 'tail' marker, except that it guarantees that tail call optimization will occur. It also comes with convervative IR verification rules that ensure that tail call optimization is possible. Reviewers: nicholas Differential Revision: http://llvm-reviews.chandlerc.com/D3240 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207143 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
533 B
LLVM
24 lines
533 B
LLVM
; RUN: llc -march=x86 < %s | FileCheck %s
|
|
|
|
; FIXME: Eliminate this tail call at -O0, since musttail is a correctness
|
|
; requirement.
|
|
; RUN: not llc -march=x86 -O0 < %s
|
|
|
|
declare void @t1_callee(i8*)
|
|
define void @t1(i32* %a) {
|
|
; CHECK-LABEL: t1:
|
|
; CHECK: jmp {{_?}}t1_callee
|
|
%b = bitcast i32* %a to i8*
|
|
musttail call void @t1_callee(i8* %b)
|
|
ret void
|
|
}
|
|
|
|
declare i8* @t2_callee()
|
|
define i32* @t2() {
|
|
; CHECK-LABEL: t2:
|
|
; CHECK: jmp {{_?}}t2_callee
|
|
%v = musttail call i8* @t2_callee()
|
|
%w = bitcast i8* %v to i32*
|
|
ret i32* %w
|
|
}
|