diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 583fe8a0fbe..2924d33a3b7 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())))