diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-10 05:52:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-10 05:52:02 +0000 |
commit | 6bdfa1c9b72130dc0b12b177ad0e69a7c7a5cc7b (patch) | |
tree | 8e6f74214ea929fff770762f9deba1dd85cf5370 /lib/Target/X86/X86Subtarget.cpp | |
parent | 180a7eec612122956e1e98559d9afd2bc6272944 (diff) | |
download | external_llvm-6bdfa1c9b72130dc0b12b177ad0e69a7c7a5cc7b.zip external_llvm-6bdfa1c9b72130dc0b12b177ad0e69a7c7a5cc7b.tar.gz external_llvm-6bdfa1c9b72130dc0b12b177ad0e69a7c7a5cc7b.tar.bz2 |
GVRequiresExtraLoad is now never used for calls, simplify it based on this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75232 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r-- | lib/Target/X86/X86Subtarget.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index d966e34..d16319b 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -39,8 +39,7 @@ AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::Unset), /// value of GV itself. This means that the GlobalAddress must be in the base /// or index register of the address, not the GV offset field. bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue *GV, - const TargetMachine &TM, - bool isDirectCall) const { + const TargetMachine &TM) const { // Windows targets only require an extra load for DLLImport linkage values, // and they need these regardless of whether we're in PIC mode or not. if (isTargetCygMing() || isTargetWindows()) @@ -51,8 +50,6 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue *GV, return false; if (isTargetDarwin()) { - if (isDirectCall) - return false; bool isDecl = GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode(); if (GV->hasHiddenVisibility() && (Is64Bit || (!isDecl && !GV->hasCommonLinkage()))) @@ -60,11 +57,9 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue *GV, // target is x86-64 or the symbol is definitely defined in the current // translation unit. return false; - return !isDirectCall && (isDecl || GV->isWeakForLinker()); + return isDecl || GV->isWeakForLinker(); } else if (isTargetELF()) { // Extra load is needed for all externally visible. - if (isDirectCall) - return false; if (GV->hasLocalLinkage() || GV->hasHiddenVisibility()) return false; return true; @@ -77,7 +72,7 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue *GV, /// a register, but not an extra load. bool X86Subtarget::GVRequiresRegister(const GlobalValue *GV, const TargetMachine &TM) const { - if (GVRequiresExtraLoad(GV, TM, false)) + if (GVRequiresExtraLoad(GV, TM)) return true; // Code below here need only consider cases where GVRequiresExtraLoad |