They are currently implicit because TargetMachine::shouldAssumeDSOLocal implies dso_local. For such function declarations, clang -fno-pic emits the dso_local specifier. Adding explicit dso_local makes these tests align with the clang behavior and helps implementing an option to use GOT indirection when taking the address of a function symbol in -fno-pic (to avoid a canonical PLT entry (SHN_UNDEF with non-zero st_value)).
16 lines
373 B
LLVM
16 lines
373 B
LLVM
; RUN: llc -mtriple=x86_64-linux < %s | FileCheck %s
|
|
|
|
; Intrinsic call to @llvm.assume should not prevent tail call optimization.
|
|
; CHECK-LABEL: foo:
|
|
; CHECK: jmp bar # TAILCALL
|
|
define i8* @foo() {
|
|
%1 = tail call i8* @bar()
|
|
%2 = icmp ne i8* %1, null
|
|
tail call void @llvm.assume(i1 %2)
|
|
ret i8* %1
|
|
}
|
|
|
|
declare dso_local i8* @bar()
|
|
declare void @llvm.assume(i1)
|
|
|