mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-26 22:26:16 +00:00
3a3465b71d
optimizations when emitting calls to the function; instead those calls may use faster relocations which require the function to be immediately resolved upon loading the dynamic object featuring the call. This is useful when it is known that the function will be called frequently and pervasively and therefore there is no merit in delaying binding of the function. Currently only implemented for x86-64, where it turns into a call through the global offset table. Patch by Dan Gohman, who assures me that he's going to add LangRef documentation for this once it's committed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133080 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
545 B
LLVM
28 lines
545 B
LLVM
; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s
|
|
|
|
declare void @lazy() nonlazybind
|
|
declare void @not()
|
|
|
|
; CHECK: foo:
|
|
; CHECK: callq _not
|
|
; CHECK: callq *_lazy@GOTPCREL(%rip)
|
|
define void @foo() nounwind {
|
|
call void @not()
|
|
call void @lazy()
|
|
ret void
|
|
}
|
|
|
|
; CHECK: tail_call_regular:
|
|
; CHECK: jmp _not
|
|
define void @tail_call_regular() nounwind {
|
|
tail call void @not()
|
|
ret void
|
|
}
|
|
|
|
; CHECK: tail_call_eager:
|
|
; CHECK: jmpq *_lazy@GOTPCREL(%rip)
|
|
define void @tail_call_eager() nounwind {
|
|
tail call void @lazy()
|
|
ret void
|
|
}
|