From: Dan Gohman Date: Mon, 8 Dec 2008 17:38:02 +0000 (+0000) Subject: Revert 60689. It caused many regressions on Darwin targets. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2d4e9bc922001000db1141da3bdc6541a586271a;p=oota-llvm.git Revert 60689. It caused many regressions on Darwin targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60705 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index c9d14d3d5d7..583fe8a0fbe 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -40,8 +40,6 @@ 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()))) @@ -49,7 +47,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 isDecl || GV->mayBeOverridden(); + return !isDirectCall && (isDecl || GV->mayBeOverridden()); } else if (isTargetELF()) { // Extra load is needed for all externally visible. if (isDirectCall)