Skip to content

Commit 00f25d2

Browse files
committed
[IR] Add "large" global variable property
This means that when using a code model where there is a distinction between "small" and "large" data (e.g. the x86-64 medium code model), treat the global as "large" regardless of its size. The intention is to use this for globals that are accessed very infrequently but also take up a lot of space in the binary to mitigate relocation overflows. Prime examples are globals that go in "__llvm_prf_names" for coverage/PGO instrumented builds and "asan_globals" for ASan builds.
1 parent 5425925 commit 00f25d2

File tree

12 files changed

+111
-39
lines changed

12 files changed

+111
-39
lines changed

llvm/docs/LangRef.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ target supports it, it will emit globals to the section specified.
695695
Additionally, the global can placed in a comdat if the target has the necessary
696696
support.
697697

698+
For code models with a small/large data distinction, a global marked ``large``
699+
is considered large regardless of its size.
700+
698701
External declarations may have an explicit section specified. Section
699702
information is retained in LLVM IR for targets that make use of this
700703
information. Attaching section information to an external declaration is an
@@ -755,7 +758,7 @@ Syntax::
755758
[(unnamed_addr|local_unnamed_addr)] [AddrSpace]
756759
[ExternallyInitialized]
757760
<global | constant> <Type> [<InitializerConstant>]
758-
[, section "name"] [, partition "name"]
761+
[, section "name"] [, large] [, partition "name"]
759762
[, comdat [($name)]] [, align <Alignment>]
760763
[, no_sanitize_address] [, no_sanitize_hwaddress]
761764
[, sanitize_address_dyninit] [, sanitize_memtag]

llvm/include/llvm/AsmParser/LLToken.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ enum Kind {
115115
kw_addrspace,
116116
kw_section,
117117
kw_partition,
118+
kw_large,
118119
kw_alias,
119120
kw_ifunc,
120121
kw_module,

llvm/include/llvm/IR/GlobalVariable.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,25 @@ class GlobalVariable : public GlobalObject, public ilist_node<GlobalVariable> {
4646
// Is this a global whose value can change from its initial value before
4747
// global initializers are run?
4848
bool isExternallyInitializedConstant : 1;
49+
// Is this global unconditionally considered large in code models with a
50+
// small/large data distinction?
51+
bool isLargeGlobal : 1;
4952

5053
public:
5154
/// GlobalVariable ctor - If a parent module is specified, the global is
5255
/// automatically inserted into the end of the specified modules global list.
5356
GlobalVariable(Type *Ty, bool isConstant, LinkageTypes Linkage,
5457
Constant *Initializer = nullptr, const Twine &Name = "",
5558
ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0,
56-
bool isExternallyInitialized = false);
59+
bool isExternallyInitialized = false, bool isLarge = false);
5760
/// GlobalVariable ctor - This creates a global and inserts it before the
5861
/// specified other global.
5962
GlobalVariable(Module &M, Type *Ty, bool isConstant, LinkageTypes Linkage,
6063
Constant *Initializer, const Twine &Name = "",
6164
GlobalVariable *InsertBefore = nullptr,
6265
ThreadLocalMode = NotThreadLocal,
6366
std::optional<unsigned> AddressSpace = std::nullopt,
64-
bool isExternallyInitialized = false);
67+
bool isExternallyInitialized = false, bool isLarge = false);
6568
GlobalVariable(const GlobalVariable &) = delete;
6669
GlobalVariable &operator=(const GlobalVariable &) = delete;
6770

@@ -159,6 +162,8 @@ class GlobalVariable : public GlobalObject, public ilist_node<GlobalVariable> {
159162
void setExternallyInitialized(bool Val) {
160163
isExternallyInitializedConstant = Val;
161164
}
165+
bool isLarge() const { return isLargeGlobal; }
166+
void setLarge(bool Val) { isLargeGlobal = Val; }
162167

163168
/// copyAttributesFrom - copy all additional attributes (those not needed to
164169
/// create a GlobalVariable) from the GlobalVariable Src to this one.

llvm/lib/AsmParser/LLLexer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ lltok::Kind LLLexer::LexIdentifier() {
570570
KEYWORD(addrspace);
571571
KEYWORD(section);
572572
KEYWORD(partition);
573+
KEYWORD(large);
573574
KEYWORD(alias);
574575
KEYWORD(ifunc);
575576
KEYWORD(module);

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,9 @@ bool LLParser::parseGlobal(const std::string &Name, LocTy NameLoc,
12861286
return true;
12871287
if (Alignment)
12881288
GV->setAlignment(*Alignment);
1289+
} else if (Lex.getKind() == lltok::kw_large) {
1290+
GV->setLarge(true);
1291+
Lex.Lex();
12891292
} else if (Lex.getKind() == lltok::MetadataVar) {
12901293
if (parseGlobalObjectMetadataAttachment(*GV))
12911294
return true;

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3917,6 +3917,9 @@ Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
39173917
NewGV->setSanitizerMetadata(Meta);
39183918
}
39193919

3920+
if (Record.size() > 17 && Record[17])
3921+
NewGV->setLarge(Record[17]);
3922+
39203923
return Error::success();
39213924
}
39223925

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ void ModuleBitcodeWriter::writeModuleInfo() {
14041404
// GLOBALVAR: [strtab offset, strtab size, type, isconst, initid,
14051405
// linkage, alignment, section, visibility, threadlocal,
14061406
// unnamed_addr, externally_initialized, dllstorageclass,
1407-
// comdat, attributes, DSO_Local, GlobalSanitizer]
1407+
// comdat, attributes, DSO_Local, GlobalSanitizer, large]
14081408
Vals.push_back(addToStrtab(GV.getName()));
14091409
Vals.push_back(GV.getName().size());
14101410
Vals.push_back(VE.getTypeID(GV.getValueType()));
@@ -1421,7 +1421,7 @@ void ModuleBitcodeWriter::writeModuleInfo() {
14211421
GV.isExternallyInitialized() ||
14221422
GV.getDLLStorageClass() != GlobalValue::DefaultStorageClass ||
14231423
GV.hasComdat() || GV.hasAttributes() || GV.isDSOLocal() ||
1424-
GV.hasPartition() || GV.hasSanitizerMetadata()) {
1424+
GV.hasPartition() || GV.hasSanitizerMetadata() || GV.isLarge()) {
14251425
Vals.push_back(getEncodedVisibility(GV));
14261426
Vals.push_back(getEncodedThreadLocalMode(GV));
14271427
Vals.push_back(getEncodedUnnamedAddr(GV));
@@ -1439,6 +1439,7 @@ void ModuleBitcodeWriter::writeModuleInfo() {
14391439
Vals.push_back((GV.hasSanitizerMetadata() ? serializeSanitizerMetadata(
14401440
GV.getSanitizerMetadata())
14411441
: 0));
1442+
Vals.push_back(GV.isLarge());
14421443
} else {
14431444
AbbrevToUse = SimpleGVarAbbrev;
14441445
}

llvm/lib/IR/AsmWriter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3642,6 +3642,8 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
36423642
printEscapedString(GV->getSection(), Out);
36433643
Out << '"';
36443644
}
3645+
if (GV->isLarge())
3646+
Out << ", large";
36453647
if (GV->hasPartition()) {
36463648
Out << ", partition \"";
36473649
printEscapedString(GV->getPartition(), Out);

llvm/lib/IR/Globals.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,13 @@ bool GlobalValue::canBeOmittedFromSymbolTable() const {
414414
GlobalVariable::GlobalVariable(Type *Ty, bool constant, LinkageTypes Link,
415415
Constant *InitVal, const Twine &Name,
416416
ThreadLocalMode TLMode, unsigned AddressSpace,
417-
bool isExternallyInitialized)
417+
bool isExternallyInitialized, bool isLarge)
418418
: GlobalObject(Ty, Value::GlobalVariableVal,
419419
OperandTraits<GlobalVariable>::op_begin(this),
420420
InitVal != nullptr, Link, Name, AddressSpace),
421421
isConstantGlobal(constant),
422-
isExternallyInitializedConstant(isExternallyInitialized) {
422+
isExternallyInitializedConstant(isExternallyInitialized),
423+
isLargeGlobal(isLarge) {
423424
assert(!Ty->isFunctionTy() && PointerType::isValidElementType(Ty) &&
424425
"invalid type for global variable");
425426
setThreadLocalMode(TLMode);
@@ -435,12 +436,12 @@ GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant,
435436
const Twine &Name, GlobalVariable *Before,
436437
ThreadLocalMode TLMode,
437438
std::optional<unsigned> AddressSpace,
438-
bool isExternallyInitialized)
439+
bool isExternallyInitialized, bool isLarge)
439440
: GlobalVariable(Ty, constant, Link, InitVal, Name, TLMode,
440441
AddressSpace
441442
? *AddressSpace
442443
: M.getDataLayout().getDefaultGlobalsAddressSpace(),
443-
isExternallyInitialized) {
444+
isExternallyInitialized, isLarge) {
444445
if (Before)
445446
Before->getParent()->insertGlobalVariable(Before->getIterator(), this);
446447
else

llvm/lib/Target/TargetMachine.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ TargetMachine::~TargetMachine() = default;
4242
bool TargetMachine::isLargeData(const GlobalVariable *GV) const {
4343
if (getTargetTriple().getArch() != Triple::x86_64 || GV->isThreadLocal())
4444
return false;
45+
if (GV->isLarge())
46+
return true;
4547
// Large data under the large code model still needs to be thought about, so
4648
// restrict this to medium.
4749
if (getCodeModel() != CodeModel::Medium)

llvm/test/Assembler/globalvariable-attributes.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@g7 = global i32 2, sanitize_address_dyninit, align 4
1010
@g8 = global i32 2, sanitize_memtag, align 4
1111
@g9 = global i32 2, no_sanitize_address, no_sanitize_hwaddress, sanitize_memtag, align 4
12+
@g10 = global i32 2, large
1213

1314
attributes #0 = { "string" = "value" nobuiltin norecurse }
1415

@@ -21,6 +22,7 @@ attributes #0 = { "string" = "value" nobuiltin norecurse }
2122
; CHECK: @g7 = global i32 2, sanitize_address_dyninit, align 4
2223
; CHECK: @g8 = global i32 2, sanitize_memtag, align 4
2324
; CHECK: @g9 = global i32 2, no_sanitize_address, no_sanitize_hwaddress, sanitize_memtag, align 4
25+
; CHECK: @g10 = global i32 2, large
2426

2527
; CHECK: attributes #0 = { "key"="value" "key2"="value2" }
2628
; CHECK: attributes #1 = { "key3"="value3" }

llvm/test/CodeGen/X86/code-model-elf.ll

Lines changed: 78 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ target triple = "x86_64--linux"
3737

3838
@global_data = dso_local global [10 x i32] [i32 1, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], align 16
3939
@static_data = internal global [10 x i32] zeroinitializer, align 16
40+
@always_large_static_data = internal global [10 x i32] zeroinitializer, align 16, large
4041
@extern_data = external global [10 x i32], align 16
4142
@thread_data = external thread_local global i32, align 4
4243
@unknown_size_data = dso_local global [0 x i32] zeroinitializer, align 16
@@ -87,6 +88,53 @@ define dso_local ptr @lea_static_data() #0 {
8788
ret ptr @static_data
8889
}
8990

91+
define dso_local ptr @lea_always_large_static_data() #0 {
92+
; SMALL-STATIC-LABEL: lea_always_large_static_data:
93+
; SMALL-STATIC: # %bb.0:
94+
; SMALL-STATIC-NEXT: movl $always_large_static_data, %eax
95+
; SMALL-STATIC-NEXT: retq
96+
;
97+
; MEDIUM-STATIC-LABEL: lea_always_large_static_data:
98+
; MEDIUM-STATIC: # %bb.0:
99+
; MEDIUM-STATIC-NEXT: movabsq $always_large_static_data, %rax
100+
; MEDIUM-STATIC-NEXT: retq
101+
;
102+
; LARGE-STATIC-LABEL: lea_always_large_static_data:
103+
; LARGE-STATIC: # %bb.0:
104+
; LARGE-STATIC-NEXT: movabsq $always_large_static_data, %rax
105+
; LARGE-STATIC-NEXT: retq
106+
;
107+
; SMALL-PIC-LABEL: lea_always_large_static_data:
108+
; SMALL-PIC: # %bb.0:
109+
; SMALL-PIC-NEXT: leaq always_large_static_data(%rip), %rax
110+
; SMALL-PIC-NEXT: retq
111+
;
112+
; MEDIUM-SMALL-DATA-PIC-LABEL: lea_always_large_static_data:
113+
; MEDIUM-SMALL-DATA-PIC: # %bb.0:
114+
; MEDIUM-SMALL-DATA-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx
115+
; MEDIUM-SMALL-DATA-PIC-NEXT: movabsq $always_large_static_data@GOTOFF, %rax
116+
; MEDIUM-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
117+
; MEDIUM-SMALL-DATA-PIC-NEXT: retq
118+
;
119+
; MEDIUM-PIC-LABEL: lea_always_large_static_data:
120+
; MEDIUM-PIC: # %bb.0:
121+
; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx
122+
; MEDIUM-PIC-NEXT: movabsq $always_large_static_data@GOTOFF, %rax
123+
; MEDIUM-PIC-NEXT: addq %rcx, %rax
124+
; MEDIUM-PIC-NEXT: retq
125+
;
126+
; LARGE-PIC-LABEL: lea_always_large_static_data:
127+
; LARGE-PIC: # %bb.0:
128+
; LARGE-PIC-NEXT: .L1$pb:
129+
; LARGE-PIC-NEXT: leaq .L1$pb(%rip), %rax
130+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L1$pb, %rcx
131+
; LARGE-PIC-NEXT: addq %rax, %rcx
132+
; LARGE-PIC-NEXT: movabsq $always_large_static_data@GOTOFF, %rax
133+
; LARGE-PIC-NEXT: addq %rcx, %rax
134+
; LARGE-PIC-NEXT: retq
135+
ret ptr @always_large_static_data
136+
}
137+
90138
define dso_local ptr @lea_global_data() #0 {
91139
; SMALL-STATIC-LABEL: lea_global_data:
92140
; SMALL-STATIC: # %bb.0:
@@ -122,9 +170,9 @@ define dso_local ptr @lea_global_data() #0 {
122170
;
123171
; LARGE-PIC-LABEL: lea_global_data:
124172
; LARGE-PIC: # %bb.0:
125-
; LARGE-PIC-NEXT: .L1$pb:
126-
; LARGE-PIC-NEXT: leaq .L1$pb(%rip), %rax
127-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L1$pb, %rcx
173+
; LARGE-PIC-NEXT: .L2$pb:
174+
; LARGE-PIC-NEXT: leaq .L2$pb(%rip), %rax
175+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L2$pb, %rcx
128176
; LARGE-PIC-NEXT: addq %rax, %rcx
129177
; LARGE-PIC-NEXT: movabsq $global_data@GOTOFF, %rax
130178
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -165,9 +213,9 @@ define dso_local ptr @lea_extern_data() #0 {
165213
;
166214
; LARGE-PIC-LABEL: lea_extern_data:
167215
; LARGE-PIC: # %bb.0:
168-
; LARGE-PIC-NEXT: .L2$pb:
169-
; LARGE-PIC-NEXT: leaq .L2$pb(%rip), %rax
170-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L2$pb, %rcx
216+
; LARGE-PIC-NEXT: .L3$pb:
217+
; LARGE-PIC-NEXT: leaq .L3$pb(%rip), %rax
218+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L3$pb, %rcx
171219
; LARGE-PIC-NEXT: addq %rax, %rcx
172220
; LARGE-PIC-NEXT: movabsq $extern_data@GOT, %rax
173221
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -212,9 +260,9 @@ define dso_local ptr @lea_unknown_size_data() #0 {
212260
;
213261
; LARGE-PIC-LABEL: lea_unknown_size_data:
214262
; LARGE-PIC: # %bb.0:
215-
; LARGE-PIC-NEXT: .L3$pb:
216-
; LARGE-PIC-NEXT: leaq .L3$pb(%rip), %rax
217-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L3$pb, %rcx
263+
; LARGE-PIC-NEXT: .L4$pb:
264+
; LARGE-PIC-NEXT: leaq .L4$pb(%rip), %rax
265+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L4$pb, %rcx
218266
; LARGE-PIC-NEXT: addq %rax, %rcx
219267
; LARGE-PIC-NEXT: movabsq $unknown_size_data@GOTOFF, %rax
220268
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -260,9 +308,9 @@ define dso_local i32 @load_global_data() #0 {
260308
;
261309
; LARGE-PIC-LABEL: load_global_data:
262310
; LARGE-PIC: # %bb.0:
263-
; LARGE-PIC-NEXT: .L4$pb:
264-
; LARGE-PIC-NEXT: leaq .L4$pb(%rip), %rax
265-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L4$pb, %rcx
311+
; LARGE-PIC-NEXT: .L5$pb:
312+
; LARGE-PIC-NEXT: leaq .L5$pb(%rip), %rax
313+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L5$pb, %rcx
266314
; LARGE-PIC-NEXT: addq %rax, %rcx
267315
; LARGE-PIC-NEXT: movabsq $global_data@GOTOFF, %rax
268316
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
@@ -310,9 +358,9 @@ define dso_local i32 @load_extern_data() #0 {
310358
;
311359
; LARGE-PIC-LABEL: load_extern_data:
312360
; LARGE-PIC: # %bb.0:
313-
; LARGE-PIC-NEXT: .L5$pb:
314-
; LARGE-PIC-NEXT: leaq .L5$pb(%rip), %rax
315-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L5$pb, %rcx
361+
; LARGE-PIC-NEXT: .L6$pb:
362+
; LARGE-PIC-NEXT: leaq .L6$pb(%rip), %rax
363+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L6$pb, %rcx
316364
; LARGE-PIC-NEXT: addq %rax, %rcx
317365
; LARGE-PIC-NEXT: movabsq $extern_data@GOT, %rax
318366
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -361,9 +409,9 @@ define dso_local i32 @load_unknown_size_data() #0 {
361409
;
362410
; LARGE-PIC-LABEL: load_unknown_size_data:
363411
; LARGE-PIC: # %bb.0:
364-
; LARGE-PIC-NEXT: .L6$pb:
365-
; LARGE-PIC-NEXT: leaq .L6$pb(%rip), %rax
366-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L6$pb, %rcx
412+
; LARGE-PIC-NEXT: .L7$pb:
413+
; LARGE-PIC-NEXT: leaq .L7$pb(%rip), %rax
414+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L7$pb, %rcx
367415
; LARGE-PIC-NEXT: addq %rax, %rcx
368416
; LARGE-PIC-NEXT: movabsq $unknown_size_data@GOTOFF, %rax
369417
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
@@ -421,9 +469,9 @@ define dso_local ptr @lea_static_fn() #0 {
421469
;
422470
; LARGE-PIC-LABEL: lea_static_fn:
423471
; LARGE-PIC: # %bb.0:
424-
; LARGE-PIC-NEXT: .L9$pb:
425-
; LARGE-PIC-NEXT: leaq .L9$pb(%rip), %rax
426-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L9$pb, %rcx
472+
; LARGE-PIC-NEXT: .L10$pb:
473+
; LARGE-PIC-NEXT: leaq .L10$pb(%rip), %rax
474+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L10$pb, %rcx
427475
; LARGE-PIC-NEXT: addq %rax, %rcx
428476
; LARGE-PIC-NEXT: movabsq $static_fn@GOTOFF, %rax
429477
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -464,9 +512,9 @@ define dso_local ptr @lea_global_fn() #0 {
464512
;
465513
; LARGE-PIC-LABEL: lea_global_fn:
466514
; LARGE-PIC: # %bb.0:
467-
; LARGE-PIC-NEXT: .L10$pb:
468-
; LARGE-PIC-NEXT: leaq .L10$pb(%rip), %rax
469-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L10$pb, %rcx
515+
; LARGE-PIC-NEXT: .L11$pb:
516+
; LARGE-PIC-NEXT: leaq .L11$pb(%rip), %rax
517+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L11$pb, %rcx
470518
; LARGE-PIC-NEXT: addq %rax, %rcx
471519
; LARGE-PIC-NEXT: movabsq $global_fn@GOTOFF, %rax
472520
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -507,9 +555,9 @@ define dso_local ptr @lea_extern_fn() #0 {
507555
;
508556
; LARGE-PIC-LABEL: lea_extern_fn:
509557
; LARGE-PIC: # %bb.0:
510-
; LARGE-PIC-NEXT: .L11$pb:
511-
; LARGE-PIC-NEXT: leaq .L11$pb(%rip), %rax
512-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L11$pb, %rcx
558+
; LARGE-PIC-NEXT: .L12$pb:
559+
; LARGE-PIC-NEXT: leaq .L12$pb(%rip), %rax
560+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L12$pb, %rcx
513561
; LARGE-PIC-NEXT: addq %rax, %rcx
514562
; LARGE-PIC-NEXT: movabsq $extern_fn@GOT, %rax
515563
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -585,9 +633,9 @@ define dso_local float @load_constant_pool(float %x) #0 {
585633
;
586634
; LARGE-PIC-LABEL: load_constant_pool:
587635
; LARGE-PIC: # %bb.0:
588-
; LARGE-PIC-NEXT: .L13$pb:
589-
; LARGE-PIC-NEXT: leaq .L13$pb(%rip), %rax
590-
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L13$pb, %rcx
636+
; LARGE-PIC-NEXT: .L14$pb:
637+
; LARGE-PIC-NEXT: leaq .L14$pb(%rip), %rax
638+
; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L14$pb, %rcx
591639
; LARGE-PIC-NEXT: addq %rax, %rcx
592640
; LARGE-PIC-NEXT: movabsq ${{\.?LCPI[0-9]+_[0-9]+}}@GOTOFF, %rax
593641
; LARGE-PIC-NEXT: addss (%rcx,%rax), %xmm0

0 commit comments

Comments
 (0)