File tree 2 files changed +15
-2
lines changed 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ static cl::opt<bool>
35
35
UseAddressTopByteIgnored (" aarch64-use-tbi" , cl::desc(" Assume that top byte of "
36
36
" an address is ignored" ), cl::init(false ), cl::Hidden);
37
37
38
+ static cl::opt<bool >
39
+ UseNonLazyBind (" aarch64-enable-nonlazybind" ,
40
+ cl::desc (" Call nonlazybind functions via direct GOT load" ),
41
+ cl::init(false ), cl::Hidden);
42
+
38
43
AArch64Subtarget &
39
44
AArch64Subtarget::initializeSubtargetDependencies (StringRef FS,
40
45
StringRef CPUString) {
@@ -165,7 +170,7 @@ unsigned char AArch64Subtarget::classifyGlobalFunctionReference(
165
170
166
171
// NonLazyBind goes via GOT unless we know it's available locally.
167
172
auto *F = dyn_cast<Function>(GV);
168
- if (F && F->hasFnAttribute (Attribute::NonLazyBind) &&
173
+ if (UseNonLazyBind && F && F->hasFnAttribute (Attribute::NonLazyBind) &&
169
174
!TM.shouldAssumeDSOLocal (*GV->getParent (), GV))
170
175
return AArch64II::MO_GOT;
171
176
Original file line number Diff line number Diff line change 1
- ; RUN: llc -mtriple=aarch64-apple-ios %s -o - | FileCheck %s
1
+ ; RUN: llc -mtriple=aarch64-apple-ios %s -o - -aarch64-enable-nonlazybind | FileCheck %s
2
+ ; RUN: llc -mtriple=aarch64-apple-ios %s -o - | FileCheck %s --check-prefix=CHECK-NORMAL
2
3
3
4
define void @local () nonlazybind {
4
5
ret void
@@ -15,6 +16,10 @@ define void @test_laziness() {
15
16
; CHECK: ldr [[FUNC:x[0-9]+]], [x[[TMP]], _nonlocal@GOTPAGEOFF]
16
17
; CHECK: blr [[FUNC]]
17
18
19
+ ; CHECK-NORMAL-LABEL: test_laziness:
20
+ ; CHECK-NORMAL: bl _local
21
+ ; CHEKC-NORMAL: bl _nonlocal
22
+
18
23
call void @local ()
19
24
call void @nonlocal ()
20
25
ret void
@@ -27,6 +32,9 @@ define void @test_laziness_tail() {
27
32
; CHECK: ldr [[FUNC:x[0-9]+]], [x[[TMP]], _nonlocal@GOTPAGEOFF]
28
33
; CHECK: br [[FUNC]]
29
34
35
+ ; CHECK-NORMAL-LABEL: test_laziness_tail:
36
+ ; CHECK-NORMAL: b _nonlocal
37
+
30
38
tail call void @nonlocal ()
31
39
ret void
32
40
}
You can’t perform that action at this time.
0 commit comments