[llvm-commits] [llvm] r75231 - in /llvm/trunk/lib/Target/X86: X86FastISel.cpp X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h

Chris Lattner sabre at nondot.org
Thu Jul 9 22:48:03 PDT 2009


Author: lattner
Date: Fri Jul 10 00:48:03 2009
New Revision: 75231

URL: http://llvm.org/viewvc/llvm-project?rev=75231&view=rev
Log:
actually, just eliminate PCRelGVRequiresExtraLoad.  It makes the code
more complex and slow than just directly testing what we care about.

Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/lib/Target/X86/X86Subtarget.cpp
    llvm/trunk/lib/Target/X86/X86Subtarget.h

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

==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Fri Jul 10 00:48:03 2009
@@ -587,7 +587,7 @@
         (AM.Base.Reg != 0 || AM.IndexReg != 0))
       return false;
 
-    // Can't handle TLS yet.
+    // Can't handle TLS or DLLImport.
     if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
       if (GVar->isThreadLocal() || GVar->hasDLLImportLinkage())
         return false;
@@ -597,7 +597,6 @@
     
     // No ABI requires an extra load for anything other than DLLImport, which
     // we rejected above. Return a direct reference to the global.
-    assert(!Subtarget->PCRelGVRequiresExtraLoad(GV, TM));
     if (Subtarget->isPICStyleRIPRel()) {
       // Use rip-relative addressing if we can.  Above we verified that the
       // base and index registers are unused.

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

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jul 10 00:48:03 2009
@@ -1902,7 +1902,7 @@
     // We should use extra load for direct calls to dllimported functions in
     // non-JIT mode.
     GlobalValue *GV = G->getGlobal();
-    if (!Subtarget->PCRelGVRequiresExtraLoad(GV, getTargetMachine())) {
+    if (!GV->hasDLLImportLinkage()) {
       unsigned char OpFlags = 0;
     
       // On ELF targets, in both X86-64 and X86-32 mode, direct calls to

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

==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Fri Jul 10 00:48:03 2009
@@ -72,19 +72,6 @@
   return false;
 }
 
-/// PCRelGVRequiresExtraLoad - True if accessing the GV from a PC-relative
-/// operand like a call target requires an extra load.
-bool X86Subtarget::PCRelGVRequiresExtraLoad(const GlobalValue *GV,
-                                            const TargetMachine &TM) const {
-  // Windows targets only require an extra load for DLLImport linkage values,
-  // and they need these regardless of whether we're in PIC mode or not.
-  if (isTargetCygMing() || isTargetWindows())
-    return GV->hasDLLImportLinkage();
-
-  return false;
-}
-
-
 /// True if accessing the GV requires a register.  This is a superset of the
 /// cases where GVRequiresExtraLoad is true.  Some variations of PIC require
 /// a register, but not an extra load.

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

==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Fri Jul 10 00:48:03 2009
@@ -204,12 +204,6 @@
   bool GVRequiresExtraLoad(const GlobalValue* GV, const TargetMachine &TM,
                            bool isDirectCall) const;
 
-  /// PCRelGVRequiresExtraLoad - True if accessing the GV from a PC-relative
-  /// operand like a call target requires an extra load.
-  bool PCRelGVRequiresExtraLoad(const GlobalValue *GV,
-                                const TargetMachine &TM) const;
-  
-  
   /// True if accessing the GV requires a register.  This is a superset of the
   /// cases where GVRequiresExtraLoad is true.  Some variations of PIC require
   /// a register, but not an extra load.





More information about the llvm-commits mailing list