[llvm-commits] [llvm] r60689 - /llvm/trunk/lib/Target/X86/X86Subtarget.cpp

Evan Cheng evan.cheng at apple.com
Sun Dec 7 22:52:43 PST 2008


Author: evancheng
Date: Mon Dec  8 00:52:43 2008
New Revision: 60689

URL: http://llvm.org/viewvc/llvm-project?rev=60689&view=rev
Log:
Perform cheap checks first.

Modified:
    llvm/trunk/lib/Target/X86/X86Subtarget.cpp

Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=60689&r1=60688&r2=60689&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Mon Dec  8 00:52:43 2008
@@ -40,6 +40,8 @@
   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 @@
         // 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)





More information about the llvm-commits mailing list