aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-12-08 06:52:43 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-12-08 06:52:43 +0000
commita8631e2943856805d92600b119c883215018f25d (patch)
tree42b6381b8095d25c5a42105450198f5d7f57d161 /lib
parent539db5126d2ca2bafe15044fc7102115ef91c04e (diff)
downloadexternal_llvm-a8631e2943856805d92600b119c883215018f25d.zip
external_llvm-a8631e2943856805d92600b119c883215018f25d.tar.gz
external_llvm-a8631e2943856805d92600b119c883215018f25d.tar.bz2
Perform cheap checks first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 583fe8a..c9d14d3 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -40,6 +40,8 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
if (TM.getRelocationModel() != Reloc::Static &&
TM.getCodeModel() != CodeModel::Large) {
if (isTargetDarwin()) {
+ if (!isDirectCall)
+ return false;
bool isDecl = GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode();
if (GV->hasHiddenVisibility() &&
(Is64Bit || (!isDecl && !GV->hasCommonLinkage())))
@@ -47,7 +49,7 @@ 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->mayBeOverridden());
+ return isDecl || GV->mayBeOverridden();
} else if (isTargetELF()) {
// Extra load is needed for all externally visible.
if (isDirectCall)