[llvm] 5e38ba2 - [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 09:28:30 PST 2023
Author: Arthur Eubanks
Date: 2023-12-14T09:28:27-08:00
New Revision: 5e38ba26d2189267a95b4dde4d7b4ae85260eaf3
URL: https://github.com/llvm/llvm-project/commit/5e38ba26d2189267a95b4dde4d7b4ae85260eaf3
DIFF: https://github.com/llvm/llvm-project/commit/5e38ba26d2189267a95b4dde4d7b4ae85260eaf3.diff
LOG: [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
For non-GlobalValue references, the small and medium code models can use
32 bit constants.
For GlobalValue references, use TargetMachine::isLargeGlobalObject().
Look through aliases for determining if a GlobalValue is small or large.
Even the large code model can reference small objects with 32 bit
constants as long as we're in no-pic mode, or if the reference is offset
from the GOT.
Added:
Modified:
llvm/include/llvm/Target/TargetMachine.h
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/lib/Target/TargetMachine.cpp
llvm/lib/Target/X86/X86FastISel.cpp
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86Subtarget.cpp
llvm/test/CodeGen/X86/code-model-elf.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index 4830ecbe1cd634..4c29f25bedf419 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -239,7 +239,7 @@ class TargetMachine {
void setCodeModel(CodeModel::Model CM) { CMModel = CM; }
void setLargeDataThreshold(uint64_t LDT) { LargeDataThreshold = LDT; }
- bool isLargeGlobalObject(const GlobalObject *GO) const;
+ bool isLargeGlobalValue(const GlobalValue *GV) const;
bool isPositionIndependent() const;
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 27d47aab4b6838..18f4d546aa82d7 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -645,7 +645,7 @@ getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind,
Name = ".rodata.cst";
Name += utostr(EntrySize);
} else {
- Name = getSectionPrefixForGlobal(Kind, TM.isLargeGlobalObject(GO));
+ Name = getSectionPrefixForGlobal(Kind, TM.isLargeGlobalValue(GO));
}
bool HasPrefix = false;
@@ -765,7 +765,7 @@ getGlobalObjectInfo(const GlobalObject *GO, const TargetMachine &TM) {
Group = C->getName();
IsComdat = C->getSelectionKind() == Comdat::Any;
}
- if (TM.isLargeGlobalObject(GO))
+ if (TM.isLargeGlobalValue(GO))
Flags |= ELF::SHF_X86_64_LARGE;
return {Group, IsComdat, Flags};
}
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 5428e14eca5f8d..3f96bd37755e58 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -39,10 +39,16 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString,
TargetMachine::~TargetMachine() = default;
-bool TargetMachine::isLargeGlobalObject(const GlobalObject *GO) const {
+bool TargetMachine::isLargeGlobalValue(const GlobalValue *GVal) const {
if (getTargetTriple().getArch() != Triple::x86_64)
return false;
+ auto *GO = GVal->getAliaseeObject();
+
+ // Be conservative if we can't find an underlying GlobalObject.
+ if (!GO)
+ return true;
+
auto *GV = dyn_cast<GlobalVariable>(GO);
// Functions/GlobalIFuncs are only large under the large code model.
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index 425c52dbe7b104..fd14a8a7dc2a9e 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -716,10 +716,8 @@ bool X86FastISel::handleConstantAddresses(const Value *V, X86AddressMode &AM) {
return false;
// Can't handle large objects yet.
- if (auto *GO = dyn_cast<GlobalObject>(GV)) {
- if (TM.isLargeGlobalObject(GO))
- return false;
- }
+ if (TM.isLargeGlobalValue(GV))
+ return false;
// Can't handle TLS yet.
if (GV->isThreadLocal())
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index 545039b79f1616..ce4fbfe88739df 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -2927,6 +2927,10 @@ bool X86DAGToDAGISel::selectAddr(SDNode *Parent, SDValue N, SDValue &Base,
}
bool X86DAGToDAGISel::selectMOV64Imm32(SDValue N, SDValue &Imm) {
+ // Cannot use 32 bit constants to reference objects in kernel code model.
+ if (TM.getCodeModel() == CodeModel::Kernel)
+ return false;
+
// In static codegen with small code model, we can get the address of a label
// into a register with 'movl'
if (N->getOpcode() != X86ISD::Wrapper)
@@ -2940,15 +2944,18 @@ bool X86DAGToDAGISel::selectMOV64Imm32(SDValue N, SDValue &Imm) {
return false;
Imm = N;
- if (N->getOpcode() != ISD::TargetGlobalAddress)
- return TM.getCodeModel() == CodeModel::Small;
+ // Small/medium code model can reference non-TargetGlobalAddress objects with
+ // 32 bit constants.
+ if (N->getOpcode() != ISD::TargetGlobalAddress) {
+ return TM.getCodeModel() == CodeModel::Small ||
+ TM.getCodeModel() == CodeModel::Medium;
+ }
- std::optional<ConstantRange> CR =
- cast<GlobalAddressSDNode>(N)->getGlobal()->getAbsoluteSymbolRange();
- if (!CR)
- return TM.getCodeModel() == CodeModel::Small;
+ const GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
+ if (std::optional<ConstantRange> CR = GV->getAbsoluteSymbolRange())
+ return CR->getUnsignedMax().ult(1ull << 32);
- return CR->getUnsignedMax().ult(1ull << 32);
+ return !TM.isLargeGlobalValue(GV);
}
bool X86DAGToDAGISel::selectLEA64_32Addr(SDValue N, SDValue &Base,
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index 0f76daffd46339..d63f1ca1695b20 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -86,16 +86,16 @@ X86Subtarget::classifyLocalReference(const GlobalValue *GV) const {
CodeModel::Model CM = TM.getCodeModel();
assert(CM != CodeModel::Tiny &&
"Tiny codesize model not supported on X86");
- // In the large code model, even referencing a global under the large data
- // threshold which is considered "small", we need to use GOTOFF.
+ // In the large code model, all text is far from any global data, so we
+ // use GOTOFF.
if (CM == CodeModel::Large)
return X86II::MO_GOTOFF;
- // Large objects use GOTOFF, otherwise use RIP-rel access.
- if (auto *GO = dyn_cast_or_null<GlobalObject>(GV))
- return TM.isLargeGlobalObject(GO) ? X86II::MO_GOTOFF
- : X86II::MO_NO_FLAG;
- // For non-GlobalObjects, the small and medium code models treat them as
- // accessible with a RIP-rel access.
+ // Large GlobalValues use GOTOFF, otherwise use RIP-rel access.
+ if (GV)
+ return TM.isLargeGlobalValue(GV) ? X86II::MO_GOTOFF : X86II::MO_NO_FLAG;
+ // GV == nullptr is for all other non-GlobalValue global data like the
+ // constant pool, jump tables, labels, etc. The small and medium code
+ // models treat these as accessible with a RIP-rel access.
return X86II::MO_NO_FLAG;
}
diff --git a/llvm/test/CodeGen/X86/code-model-elf.ll b/llvm/test/CodeGen/X86/code-model-elf.ll
index 0f58ccaf298dab..a43736e2a5884a 100644
--- a/llvm/test/CodeGen/X86/code-model-elf.ll
+++ b/llvm/test/CodeGen/X86/code-model-elf.ll
@@ -40,6 +40,7 @@ target triple = "x86_64--linux"
@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
@static_data = internal global [10 x i32] zeroinitializer, align 16
+ at static_data_alias = internal constant ptr getelementptr inbounds ([10 x i32], ptr @static_data, i64 0, i64 2), align 8
@extern_data = external global [10 x i32], align 16
@thread_data = external thread_local global i32, align 4
@unknown_size_data = dso_local global [0 x i32] zeroinitializer, align 16
@@ -96,12 +97,67 @@ define dso_local ptr @lea_static_data() #0 {
; LARGE-SMALL-DATA-PIC-NEXT: leaq .L0$pb(%rip), %rax
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L0$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $static_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl $static_data at GOTOFF, %eax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @static_data
}
+define dso_local ptr @lea_static_data_alias() #0 {
+; SMALL-STATIC-LABEL: lea_static_data_alias:
+; SMALL-STATIC: # %bb.0:
+; SMALL-STATIC-NEXT: movl $static_data_alias, %eax
+; SMALL-STATIC-NEXT: retq
+;
+; MEDIUM-STATIC-LABEL: lea_static_data_alias:
+; MEDIUM-STATIC: # %bb.0:
+; MEDIUM-STATIC-NEXT: movabsq $static_data_alias, %rax
+; MEDIUM-STATIC-NEXT: retq
+;
+; LARGE-STATIC-LABEL: lea_static_data_alias:
+; LARGE-STATIC: # %bb.0:
+; LARGE-STATIC-NEXT: movabsq $static_data_alias, %rax
+; LARGE-STATIC-NEXT: retq
+;
+; SMALL-PIC-LABEL: lea_static_data_alias:
+; SMALL-PIC: # %bb.0:
+; SMALL-PIC-NEXT: leaq static_data_alias(%rip), %rax
+; SMALL-PIC-NEXT: retq
+;
+; MEDIUM-SMALL-DATA-PIC-LABEL: lea_static_data_alias:
+; MEDIUM-SMALL-DATA-PIC: # %bb.0:
+; MEDIUM-SMALL-DATA-PIC-NEXT: leaq static_data_alias(%rip), %rax
+; MEDIUM-SMALL-DATA-PIC-NEXT: retq
+;
+; MEDIUM-PIC-LABEL: lea_static_data_alias:
+; MEDIUM-PIC: # %bb.0:
+; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx
+; MEDIUM-PIC-NEXT: movabsq $static_data_alias at GOTOFF, %rax
+; MEDIUM-PIC-NEXT: addq %rcx, %rax
+; MEDIUM-PIC-NEXT: retq
+;
+; LARGE-PIC-LABEL: lea_static_data_alias:
+; LARGE-PIC: # %bb.0:
+; LARGE-PIC-NEXT: .L1$pb:
+; LARGE-PIC-NEXT: leaq .L1$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L1$pb, %rcx
+; LARGE-PIC-NEXT: addq %rax, %rcx
+; LARGE-PIC-NEXT: movabsq $static_data_alias at GOTOFF, %rax
+; LARGE-PIC-NEXT: addq %rcx, %rax
+; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_static_data_alias:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L1$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L1$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L1$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movl $static_data_alias at GOTOFF, %eax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
+ ret ptr @static_data_alias
+}
+
define dso_local ptr @lea_global_data() #0 {
; SMALL-STATIC-LABEL: lea_global_data:
; SMALL-STATIC: # %bb.0:
@@ -137,9 +193,9 @@ define dso_local ptr @lea_global_data() #0 {
;
; LARGE-PIC-LABEL: lea_global_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L1$pb:
-; LARGE-PIC-NEXT: leaq .L1$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L1$pb, %rcx
+; LARGE-PIC-NEXT: .L2$pb:
+; LARGE-PIC-NEXT: leaq .L2$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L2$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -147,11 +203,11 @@ define dso_local ptr @lea_global_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_global_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L1$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L1$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L1$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L2$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L2$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L2$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl $global_data at GOTOFF, %eax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @global_data
@@ -190,9 +246,9 @@ define dso_local ptr @lea_extern_data() #0 {
;
; LARGE-PIC-LABEL: lea_extern_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L2$pb:
-; LARGE-PIC-NEXT: leaq .L2$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L2$pb, %rcx
+; LARGE-PIC-NEXT: .L3$pb:
+; LARGE-PIC-NEXT: leaq .L3$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L3$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $extern_data at GOT, %rax
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -200,11 +256,11 @@ define dso_local ptr @lea_extern_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_extern_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L2$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L2$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L2$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L3$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L3$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L3$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $extern_data at GOT, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl $extern_data at GOT, %eax
; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @extern_data
@@ -247,9 +303,9 @@ define dso_local ptr @lea_unknown_size_data() #0 {
;
; LARGE-PIC-LABEL: lea_unknown_size_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L3$pb:
-; LARGE-PIC-NEXT: leaq .L3$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L3$pb, %rcx
+; LARGE-PIC-NEXT: .L4$pb:
+; LARGE-PIC-NEXT: leaq .L4$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L4$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -257,9 +313,9 @@ define dso_local ptr @lea_unknown_size_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_unknown_size_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L3$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L3$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L3$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L4$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L4$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L4$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
@@ -267,7 +323,6 @@ define dso_local ptr @lea_unknown_size_data() #0 {
ret ptr @unknown_size_data
}
-; TODO: make nopic small and medium instruction sequence the same
define dso_local ptr @lea_forced_small_data() #0 {
; SMALL-STATIC-LABEL: lea_forced_small_data:
; SMALL-STATIC: # %bb.0:
@@ -276,12 +331,12 @@ define dso_local ptr @lea_forced_small_data() #0 {
;
; MEDIUM-STATIC-LABEL: lea_forced_small_data:
; MEDIUM-STATIC: # %bb.0:
-; MEDIUM-STATIC-NEXT: movabsq $forced_small_data, %rax
+; MEDIUM-STATIC-NEXT: movl $forced_small_data, %eax
; MEDIUM-STATIC-NEXT: retq
;
; LARGE-STATIC-LABEL: lea_forced_small_data:
; LARGE-STATIC: # %bb.0:
-; LARGE-STATIC-NEXT: movabsq $forced_small_data, %rax
+; LARGE-STATIC-NEXT: movl $forced_small_data, %eax
; LARGE-STATIC-NEXT: retq
;
; SMALL-PIC-LABEL: lea_forced_small_data:
@@ -301,21 +356,21 @@ define dso_local ptr @lea_forced_small_data() #0 {
;
; LARGE-PIC-LABEL: lea_forced_small_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L4$pb:
-; LARGE-PIC-NEXT: leaq .L4$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L4$pb, %rcx
+; LARGE-PIC-NEXT: .L5$pb:
+; LARGE-PIC-NEXT: leaq .L5$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L5$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
-; LARGE-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
+; LARGE-PIC-NEXT: movl $forced_small_data at GOTOFF, %eax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_forced_small_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L4$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L4$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L4$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L5$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L5$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L5$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl $forced_small_data at GOTOFF, %eax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @forced_small_data
@@ -330,13 +385,13 @@ define dso_local i32 @load_forced_small_data() #0 {
;
; MEDIUM-STATIC-LABEL: load_forced_small_data:
; MEDIUM-STATIC: # %bb.0:
-; MEDIUM-STATIC-NEXT: movabsq $forced_small_data, %rax
+; MEDIUM-STATIC-NEXT: movl $forced_small_data, %eax
; MEDIUM-STATIC-NEXT: movl 8(%rax), %eax
; MEDIUM-STATIC-NEXT: retq
;
; LARGE-STATIC-LABEL: load_forced_small_data:
; LARGE-STATIC: # %bb.0:
-; LARGE-STATIC-NEXT: movabsq $forced_small_data, %rax
+; LARGE-STATIC-NEXT: movl $forced_small_data, %eax
; LARGE-STATIC-NEXT: movl 8(%rax), %eax
; LARGE-STATIC-NEXT: retq
;
@@ -359,21 +414,21 @@ define dso_local i32 @load_forced_small_data() #0 {
;
; LARGE-PIC-LABEL: load_forced_small_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L5$pb:
-; LARGE-PIC-NEXT: leaq .L5$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L5$pb, %rcx
+; LARGE-PIC-NEXT: .L6$pb:
+; LARGE-PIC-NEXT: leaq .L6$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L6$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
-; LARGE-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
+; LARGE-PIC-NEXT: movl $forced_small_data at GOTOFF, %eax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
; LARGE-PIC-NEXT: retq
;
; LARGE-SMALL-DATA-PIC-LABEL: load_forced_small_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L5$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L5$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L5$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L6$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L6$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L6$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl $forced_small_data at GOTOFF, %eax
; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
; LARGE-SMALL-DATA-PIC-NEXT: retq
%rv = load i32, ptr getelementptr inbounds (i32, ptr @forced_small_data, i64 2)
@@ -384,7 +439,7 @@ define dso_local i32 @load_forced_small_data() #0 {
define dso_local ptr @lea_forced_large_data() #0 {
; SMALL-STATIC-LABEL: lea_forced_large_data:
; SMALL-STATIC: # %bb.0:
-; SMALL-STATIC-NEXT: movl $forced_large_data, %eax
+; SMALL-STATIC-NEXT: movabsq $forced_large_data, %rax
; SMALL-STATIC-NEXT: retq
;
; MEDIUM-STATIC-LABEL: lea_forced_large_data:
@@ -419,9 +474,9 @@ define dso_local ptr @lea_forced_large_data() #0 {
;
; LARGE-PIC-LABEL: lea_forced_large_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L6$pb:
-; LARGE-PIC-NEXT: leaq .L6$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L6$pb, %rcx
+; LARGE-PIC-NEXT: .L7$pb:
+; LARGE-PIC-NEXT: leaq .L7$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L7$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -429,9 +484,9 @@ define dso_local ptr @lea_forced_large_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_forced_large_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L6$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L6$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L6$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L7$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L7$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L7$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
@@ -479,9 +534,9 @@ define dso_local i32 @load_forced_large_data() #0 {
;
; LARGE-PIC-LABEL: load_forced_large_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L7$pb:
-; LARGE-PIC-NEXT: leaq .L7$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L7$pb, %rcx
+; LARGE-PIC-NEXT: .L8$pb:
+; LARGE-PIC-NEXT: leaq .L8$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L8$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
@@ -489,9 +544,9 @@ define dso_local i32 @load_forced_large_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: load_forced_large_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L7$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L7$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L7$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L8$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L8$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L8$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
@@ -538,9 +593,9 @@ define dso_local i32 @load_global_data() #0 {
;
; LARGE-PIC-LABEL: load_global_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L8$pb:
-; LARGE-PIC-NEXT: leaq .L8$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L8$pb, %rcx
+; LARGE-PIC-NEXT: .L9$pb:
+; LARGE-PIC-NEXT: leaq .L9$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L9$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
@@ -548,11 +603,11 @@ define dso_local i32 @load_global_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: load_global_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L8$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L8$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L8$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L9$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L9$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L9$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl $global_data at GOTOFF, %eax
; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
; LARGE-SMALL-DATA-PIC-NEXT: retq
%rv = load i32, ptr getelementptr inbounds ([10 x i32], ptr @global_data, i64 0, i64 2)
@@ -598,9 +653,9 @@ define dso_local i32 @load_extern_data() #0 {
;
; LARGE-PIC-LABEL: load_extern_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L9$pb:
-; LARGE-PIC-NEXT: leaq .L9$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L9$pb, %rcx
+; LARGE-PIC-NEXT: .L10$pb:
+; LARGE-PIC-NEXT: leaq .L10$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L10$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $extern_data at GOT, %rax
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -609,11 +664,11 @@ define dso_local i32 @load_extern_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: load_extern_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L9$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L9$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L9$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L10$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L10$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L10$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $extern_data at GOT, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl $extern_data at GOT, %eax
; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rax), %eax
; LARGE-SMALL-DATA-PIC-NEXT: retq
@@ -660,9 +715,9 @@ define dso_local i32 @load_unknown_size_data() #0 {
;
; LARGE-PIC-LABEL: load_unknown_size_data:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L10$pb:
-; LARGE-PIC-NEXT: leaq .L10$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L10$pb, %rcx
+; LARGE-PIC-NEXT: .L11$pb:
+; LARGE-PIC-NEXT: leaq .L11$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L11$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
@@ -670,9 +725,9 @@ define dso_local i32 @load_unknown_size_data() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: load_unknown_size_data:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L10$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L10$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L10$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L11$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L11$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L11$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
@@ -718,9 +773,9 @@ define dso_local ptr @lea_opaque() #0 {
;
; LARGE-PIC-LABEL: lea_opaque:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L11$pb:
-; LARGE-PIC-NEXT: leaq .L11$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L11$pb, %rcx
+; LARGE-PIC-NEXT: .L12$pb:
+; LARGE-PIC-NEXT: leaq .L12$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L12$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $opaque at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -728,9 +783,9 @@ define dso_local ptr @lea_opaque() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_opaque:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L11$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L11$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L11$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L12$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L12$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L12$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $opaque at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
@@ -799,9 +854,9 @@ define dso_local ptr @lea_static_fn() #0 {
;
; LARGE-PIC-LABEL: lea_static_fn:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L15$pb:
-; LARGE-PIC-NEXT: leaq .L15$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L15$pb, %rcx
+; LARGE-PIC-NEXT: .L16$pb:
+; LARGE-PIC-NEXT: leaq .L16$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L16$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $static_fn at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -809,9 +864,9 @@ define dso_local ptr @lea_static_fn() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_static_fn:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L15$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L15$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L15$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L16$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L16$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L16$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $static_fn at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
@@ -852,9 +907,9 @@ define dso_local ptr @lea_global_fn() #0 {
;
; LARGE-PIC-LABEL: lea_global_fn:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L16$pb:
-; LARGE-PIC-NEXT: leaq .L16$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L16$pb, %rcx
+; LARGE-PIC-NEXT: .L17$pb:
+; LARGE-PIC-NEXT: leaq .L17$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L17$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $global_fn at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -862,9 +917,9 @@ define dso_local ptr @lea_global_fn() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_global_fn:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L16$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L16$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L16$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L17$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L17$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L17$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $global_fn at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
@@ -905,9 +960,9 @@ define dso_local ptr @lea_extern_fn() #0 {
;
; LARGE-PIC-LABEL: lea_extern_fn:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L17$pb:
-; LARGE-PIC-NEXT: leaq .L17$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L17$pb, %rcx
+; LARGE-PIC-NEXT: .L18$pb:
+; LARGE-PIC-NEXT: leaq .L18$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L18$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $extern_fn at GOT, %rax
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -915,9 +970,9 @@ define dso_local ptr @lea_extern_fn() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_extern_fn:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L17$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L17$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L17$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L18$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L18$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L18$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $extern_fn at GOT, %rax
; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -958,9 +1013,9 @@ define dso_local ptr @lea_ifunc() #0 {
;
; LARGE-PIC-LABEL: lea_ifunc:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L18$pb:
-; LARGE-PIC-NEXT: leaq .L18$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L18$pb, %rcx
+; LARGE-PIC-NEXT: .L19$pb:
+; LARGE-PIC-NEXT: leaq .L19$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L19$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $ifunc_func at GOT, %rax
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -968,9 +1023,9 @@ define dso_local ptr @lea_ifunc() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_ifunc:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L18$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L18$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L18$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L19$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L19$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L19$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $ifunc_func at GOT, %rax
; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
@@ -986,7 +1041,7 @@ define dso_local ptr @lea_dso_local_ifunc() #0 {
;
; MEDIUM-STATIC-LABEL: lea_dso_local_ifunc:
; MEDIUM-STATIC: # %bb.0:
-; MEDIUM-STATIC-NEXT: movabsq $dso_local_ifunc_func, %rax
+; MEDIUM-STATIC-NEXT: movl $dso_local_ifunc_func, %eax
; MEDIUM-STATIC-NEXT: retq
;
; LARGE-STATIC-LABEL: lea_dso_local_ifunc:
@@ -1011,9 +1066,9 @@ define dso_local ptr @lea_dso_local_ifunc() #0 {
;
; LARGE-PIC-LABEL: lea_dso_local_ifunc:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L19$pb:
-; LARGE-PIC-NEXT: leaq .L19$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L19$pb, %rcx
+; LARGE-PIC-NEXT: .L20$pb:
+; LARGE-PIC-NEXT: leaq .L20$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L20$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq $dso_local_ifunc_func at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
@@ -1021,9 +1076,9 @@ define dso_local ptr @lea_dso_local_ifunc() #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: lea_dso_local_ifunc:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L19$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L19$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L19$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L20$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L20$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L20$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq $dso_local_ifunc_func at GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
@@ -1072,7 +1127,7 @@ define dso_local float @load_constant_pool(float %x) #0 {
;
; MEDIUM-STATIC-LABEL: load_constant_pool:
; MEDIUM-STATIC: # %bb.0:
-; MEDIUM-STATIC-NEXT: movabsq ${{\.?LCPI[0-9]+_[0-9]+}}, %rax
+; MEDIUM-STATIC-NEXT: movl ${{\.?LCPI[0-9]+_[0-9]+}}, %eax
; MEDIUM-STATIC-NEXT: addss (%rax), %xmm0
; MEDIUM-STATIC-NEXT: retq
;
@@ -1099,9 +1154,9 @@ define dso_local float @load_constant_pool(float %x) #0 {
;
; LARGE-PIC-LABEL: load_constant_pool:
; LARGE-PIC: # %bb.0:
-; LARGE-PIC-NEXT: .L21$pb:
-; LARGE-PIC-NEXT: leaq .L21$pb(%rip), %rax
-; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L21$pb, %rcx
+; LARGE-PIC-NEXT: .L22$pb:
+; LARGE-PIC-NEXT: leaq .L22$pb(%rip), %rax
+; LARGE-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L22$pb, %rcx
; LARGE-PIC-NEXT: addq %rax, %rcx
; LARGE-PIC-NEXT: movabsq ${{\.?LCPI[0-9]+_[0-9]+}}@GOTOFF, %rax
; LARGE-PIC-NEXT: addss (%rcx,%rax), %xmm0
@@ -1109,9 +1164,9 @@ define dso_local float @load_constant_pool(float %x) #0 {
;
; LARGE-SMALL-DATA-PIC-LABEL: load_constant_pool:
; LARGE-SMALL-DATA-PIC: # %bb.0:
-; LARGE-SMALL-DATA-PIC-NEXT: .L21$pb:
-; LARGE-SMALL-DATA-PIC-NEXT: leaq .L21$pb(%rip), %rax
-; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L21$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: .L22$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L22$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L22$pb, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
; LARGE-SMALL-DATA-PIC-NEXT: movabsq ${{\.?LCPI[0-9]+_[0-9]+}}@GOTOFF, %rax
; LARGE-SMALL-DATA-PIC-NEXT: addss (%rcx,%rax), %xmm0
More information about the llvm-commits
mailing list