diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-12-08 06:52:43 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-12-08 06:52:43 +0000 |
commit | 50fcc67a8b9a79eb15c57cb78558ccdce2fdf614 (patch) | |
tree | 0b8c5e2f68db496a1d1613b233631b64d5b83e46 /llvm/lib | |
parent | 63c38a6630f1d49697cf7a9babe8e53507fe27c0 (diff) | |
download | bcm5719-llvm-50fcc67a8b9a79eb15c57cb78558ccdce2fdf614.tar.gz bcm5719-llvm-50fcc67a8b9a79eb15c57cb78558ccdce2fdf614.zip |
Perform cheap checks first.
llvm-svn: 60689
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp index 583fe8a0fbe..c9d14d3d5d7 100644 --- a/llvm/lib/Target/X86/X86Subtarget.cpp +++ b/llvm/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) |