[llvm-commits] [llvm] r77114 - in /llvm/trunk: include/llvm/Target/ lib/Support/ lib/Target/ARM/TargetInfo/ lib/Target/Alpha/TargetInfo/ lib/Target/CBackend/TargetInfo/ lib/Target/CellSPU/TargetInfo/ lib/Target/CppBackend/TargetInfo/ lib/Target/MSIL/TargetInfo/ lib/Target/MSP430/TargetInfo/ lib/Target/Mips/TargetInfo/ lib/Target/PIC16/TargetInfo/ lib/Target/PowerPC/TargetInfo/ lib/Target/Sparc/TargetInfo/ lib/Target/SystemZ/TargetInfo/ lib/Target/X86/TargetInfo/ lib/Target/XCore/TargetInfo/

Daniel Dunbar daniel at zuster.org
Sat Jul 25 19:22:58 PDT 2009


Author: ddunbar
Date: Sat Jul 25 21:22:58 2009
New Revision: 77114

URL: http://llvm.org/viewvc/llvm-project?rev=77114&view=rev
Log:
Kill Target specific ModuleMatchQuality stuff.
 - This was overkill and inconsistently implemented.

Modified:
    llvm/trunk/include/llvm/Target/TargetRegistry.h
    llvm/trunk/lib/Support/TargetRegistry.cpp
    llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
    llvm/trunk/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp
    llvm/trunk/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp
    llvm/trunk/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp
    llvm/trunk/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp
    llvm/trunk/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp
    llvm/trunk/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp
    llvm/trunk/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp
    llvm/trunk/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp
    llvm/trunk/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp
    llvm/trunk/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp
    llvm/trunk/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp
    llvm/trunk/lib/Target/X86/TargetInfo/X86TargetInfo.cpp
    llvm/trunk/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp

Modified: llvm/trunk/include/llvm/Target/TargetRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegistry.h?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetRegistry.h (original)
+++ llvm/trunk/include/llvm/Target/TargetRegistry.h Sat Jul 25 21:22:58 2009
@@ -43,8 +43,6 @@
   class Target {
   private:
     typedef unsigned (*TripleMatchQualityFnTy)(const std::string &TT);
-    typedef unsigned (*ModuleMatchQualityFnTy)(const Module &M);
-    typedef unsigned (*JITMatchQualityFnTy)();
 
     typedef TargetMachine *(*TargetMachineCtorTy)(const Target &,
                                                   const Module &, 
@@ -64,10 +62,6 @@
     /// of a triple.
     TripleMatchQualityFnTy TripleMatchQualityFn;
 
-    /// ModuleMatchQualityFn - The target function for rating the match quality
-    /// of a module.
-    ModuleMatchQualityFnTy ModuleMatchQualityFn;
-
     /// Name - The target name.
     const char *Name;
 
@@ -222,15 +216,12 @@
     /// string. 
     /// @param TQualityFn - The triple match quality computation function for
     /// this target.
-    /// @param MQualityFn - The module match quality computation function for
-    /// this target.
     /// @param HasJIT - Whether the target supports JIT code
     /// generation.
     static void RegisterTarget(Target &T,
                                const char *Name,
                                const char *ShortDesc,
                                Target::TripleMatchQualityFnTy TQualityFn,
-                               Target::ModuleMatchQualityFnTy MQualityFn,
                                bool HasJIT = false);
                                
     /// RegisterTargetMachine - Register a TargetMachine implementation for the
@@ -294,9 +285,7 @@
   ///   struct FooInfo {
   ///     static const bool HasJIT = ...;
   ///
-  ///     static unsigned getJITMatchQuality() { ... }
   ///     static unsigned getTripleMatchQuality(const std::string &) { ... }
-  ///     static unsigned getModuleMatchQuality(const Module &) { ... }
   ///   };
   /// }
   ///
@@ -308,7 +297,6 @@
     RegisterTarget(Target &T, const char *Name, const char *Desc) {
       TargetRegistry::RegisterTarget(T, Name, Desc,
                                      &TargetInfoImpl::getTripleMatchQuality,
-                                     &TargetInfoImpl::getModuleMatchQuality,
                                      TargetInfoImpl::HasJIT);
     }
   };

Modified: llvm/trunk/lib/Support/TargetRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/TargetRegistry.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Support/TargetRegistry.cpp (original)
+++ llvm/trunk/lib/Support/TargetRegistry.cpp Sat Jul 25 21:22:58 2009
@@ -74,9 +74,8 @@
                                     const char *Name,
                                     const char *ShortDesc,
                                     Target::TripleMatchQualityFnTy TQualityFn,
-                                    Target::ModuleMatchQualityFnTy MQualityFn,
                                     bool HasJIT) {
-  assert(Name && ShortDesc && TQualityFn && MQualityFn &&
+  assert(Name && ShortDesc && TQualityFn &&
          "Missing required target information!");
 
   // Check if this target has already been initialized, we allow this as a
@@ -91,7 +90,6 @@
   T.Name = Name;
   T.ShortDesc = ShortDesc;
   T.TripleMatchQualityFn = TQualityFn;
-  T.ModuleMatchQualityFn = MQualityFn;
   T.HasJIT = HasJIT;
 }
 

Modified: llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -23,24 +23,6 @@
   return 0;
 }
 
-static unsigned ARM_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = ARM_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  if (M.getEndianness()  == Module::LittleEndian &&
-      M.getPointerSize() == Module::Pointer32)
-    return 10;                                   // Weak match
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-
-  return 0;
-}
-
 Target llvm::TheThumbTarget;
 
 static unsigned Thumb_TripleMatchQuality(const std::string &TT) {
@@ -52,34 +34,14 @@
   return 0;
 }
 
-static unsigned Thumb_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = Thumb_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  if (M.getEndianness()  == Module::LittleEndian &&
-      M.getPointerSize() == Module::Pointer32)
-    return 10;                                   // Weak match
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-
-  return 0;
-}
-
 extern "C" void LLVMInitializeARMTargetInfo() { 
   TargetRegistry::RegisterTarget(TheARMTarget, "arm",    
                                   "ARM",
                                   &ARM_TripleMatchQuality,
-                                  &ARM_ModuleMatchQuality,
                                  /*HasJIT=*/true);
 
   TargetRegistry::RegisterTarget(TheThumbTarget, "thumb",    
                                   "Thumb",
                                   &Thumb_TripleMatchQuality,
-                                  &Thumb_ModuleMatchQuality,
                                  /*HasJIT=*/true);
 }

Modified: llvm/trunk/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -23,28 +23,9 @@
   return 0;
 }
 
-static unsigned Alpha_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = Alpha_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  if (M.getEndianness()  == Module::LittleEndian &&
-      M.getPointerSize() == Module::Pointer64)
-    return 10;                                   // Weak match
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-
-  return 0;
-}
-
 extern "C" void LLVMInitializeAlphaTargetInfo() { 
   TargetRegistry::RegisterTarget(TheAlphaTarget, "alpha",
                                   "Alpha [experimental]",
                                   &Alpha_TripleMatchQuality,
-                                  &Alpha_ModuleMatchQuality,
                                   /*HasJIT=*/true);
 }

Modified: llvm/trunk/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -20,15 +20,8 @@
   return 0;
 }
 
-static unsigned CBackend_ModuleMatchQuality(const Module &M) {
-  // This class always works, but must be requested explicitly on 
-  // llc command line.
-  return 0;
-}
-
 extern "C" void LLVMInitializeCBackendTargetInfo() { 
   TargetRegistry::RegisterTarget(TheCBackendTarget, "c",
                                   "C backend",
-                                  &CBackend_TripleMatchQuality,
-                                  &CBackend_ModuleMatchQuality);
+                                  &CBackend_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -25,20 +25,8 @@
   return 0;
 }
 
-static unsigned CellSPU_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = CellSPU_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  return 0;
-}
-
 extern "C" void LLVMInitializeCellSPUTargetInfo() { 
   TargetRegistry::RegisterTarget(TheCellSPUTarget, "cellspu",
                                   "STI CBEA Cell SPU [experimental]",
-                                  &CellSPU_TripleMatchQuality,
-                                  &CellSPU_ModuleMatchQuality);
+                                  &CellSPU_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -19,14 +19,8 @@
   return 1;
 }
 
-static unsigned CppBackend_ModuleMatchQuality(const Module &M) {
-  // This class always works, but shouldn't be the default in most cases.
-  return 1;
-}
-
 extern "C" void LLVMInitializeCppBackendTargetInfo() { 
   TargetRegistry::RegisterTarget(TheCppBackendTarget, "cpp",    
                                   "C++ backend",
-                                  &CppBackend_TripleMatchQuality,
-                                  &CppBackend_ModuleMatchQuality);
+                                  &CppBackend_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -19,14 +19,8 @@
   return 1;
 }
 
-static unsigned MSIL_ModuleMatchQuality(const Module &M) {
-  // This class always works, but shouldn't be the default in most cases.
-  return 1;
-}
-
 extern "C" void LLVMInitializeMSILTargetInfo() { 
   TargetRegistry::RegisterTarget(TheMSILTarget, "msil",    
                                   "MSIL backend",
-                                  &MSIL_TripleMatchQuality,
-                                  &MSIL_ModuleMatchQuality);
+                                  &MSIL_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -23,20 +23,8 @@
   return 0;
 }
 
-static unsigned MSP430_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = MSP430_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  return 0;
-}
-
 extern "C" void LLVMInitializeMSP430TargetInfo() { 
   TargetRegistry::RegisterTarget(TheMSP430Target, "msp430",    
                                   "MSP430 [experimental]",
-                                  &MSP430_TripleMatchQuality,
-                                  &MSP430_ModuleMatchQuality);
+                                  &MSP430_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -26,17 +26,6 @@
   return 0;
 }
 
-static unsigned Mips_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = Mips_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  return 0;
-}
-
 Target llvm::TheMipselTarget;
 
 static unsigned Mipsel_TripleMatchQuality(const std::string &TT) {
@@ -54,25 +43,12 @@
   return 0;
 }
 
-static unsigned Mipsel_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = Mipsel_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  return 0;
-}
-
 extern "C" void LLVMInitializeMipsTargetInfo() { 
   TargetRegistry::RegisterTarget(TheMipsTarget, "mips",
                                   "Mips",
-                                  &Mips_TripleMatchQuality,
-                                  &Mips_ModuleMatchQuality);
+                                  &Mips_TripleMatchQuality);
 
   TargetRegistry::RegisterTarget(TheMipselTarget, "mipsel",
                                   "Mipsel",
-                                  &Mipsel_TripleMatchQuality,
-                                  &Mipsel_ModuleMatchQuality);
+                                  &Mipsel_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -18,28 +18,18 @@
   return 0;
 }
 
-static unsigned PIC16_ModuleMatchQuality(const Module &M) {
-  return 0;
-}
-
 Target llvm::TheCooperTarget;
 
 static unsigned Cooper_TripleMatchQuality(const std::string &TT) {
   return 0;
 }
 
-static unsigned Cooper_ModuleMatchQuality(const Module &M) {
-  return 0;
-}
-
 extern "C" void LLVMInitializePIC16TargetInfo() { 
   TargetRegistry::RegisterTarget(ThePIC16Target, "pic16",
                                   "PIC16 14-bit [experimental]",
-                                  &PIC16_TripleMatchQuality,
-                                  &PIC16_ModuleMatchQuality);
+                                  &PIC16_TripleMatchQuality);
 
   TargetRegistry::RegisterTarget(TheCooperTarget, "cooper",    
                                   "PIC16 Cooper [experimental]",
-                                  &Cooper_TripleMatchQuality,
-                                  &Cooper_ModuleMatchQuality);
+                                  &Cooper_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -22,24 +22,6 @@
   return 0;
 }
 
-static unsigned PPC32_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = PPC32_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  if (M.getEndianness()  == Module::BigEndian &&
-      M.getPointerSize() == Module::Pointer64)
-    return 10;                                   // Weak match
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-  
-  return 0;
-}
-
 Target llvm::ThePPC64Target;
 
 static unsigned PPC64_TripleMatchQuality(const std::string &TT) {
@@ -50,34 +32,14 @@
   return 0;
 }
 
-static unsigned PPC64_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = PPC64_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-  
-  if (M.getEndianness()  == Module::BigEndian &&
-      M.getPointerSize() == Module::Pointer64)
-    return 10;                                   // Weak match
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-  
-  return 0;
-}
-
 extern "C" void LLVMInitializePowerPCTargetInfo() { 
   TargetRegistry::RegisterTarget(ThePPC32Target, "ppc32",
                                   "PowerPC 32",
                                   &PPC32_TripleMatchQuality,
-                                  &PPC32_ModuleMatchQuality,
                                  /*HasJIT=*/true);
 
   TargetRegistry::RegisterTarget(ThePPC64Target, "ppc64",
                                   "PowerPC 64",
                                   &PPC64_TripleMatchQuality,
-                                  &PPC64_ModuleMatchQuality,
                                  /*HasJIT=*/true);
 }

Modified: llvm/trunk/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -21,37 +21,8 @@
   return 0;
 }
 
-static unsigned Sparc_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = Sparc_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise if the target triple is non-empty, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  // FIXME: This is bad, the target matching algorithm shouldn't depend on the
-  // host.
-  if (M.getEndianness()  == Module::BigEndian &&
-      M.getPointerSize() == Module::Pointer32)
-#ifdef __sparc__
-    return 20;   // BE/32 ==> Prefer sparc on sparc
-#else
-    return 5;    // BE/32 ==> Prefer ppc elsewhere
-#endif
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-
-#if defined(__sparc__)
-  return 10;
-#else
-  return 0;
-#endif
-}
-
 extern "C" void LLVMInitializeSparcTargetInfo() { 
   TargetRegistry::RegisterTarget(TheSparcTarget, "sparc",
                                   "Sparc",
-                                  &Sparc_TripleMatchQuality,
-                                  &Sparc_ModuleMatchQuality);
+                                  &Sparc_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -23,18 +23,8 @@
   return 0;
 }
 
-static unsigned SystemZ_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = SystemZ_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise we don't match.
-  return 0;
-}
-
 extern "C" void LLVMInitializeSystemZTargetInfo() {
   TargetRegistry::RegisterTarget(TheSystemZTarget, "systemz",
                                  "SystemZ",
-                                 &SystemZ_TripleMatchQuality,
-                                 &SystemZ_ModuleMatchQuality);
+                                 &SystemZ_TripleMatchQuality);
 }

Modified: llvm/trunk/lib/Target/X86/TargetInfo/X86TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/TargetInfo/X86TargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/TargetInfo/X86TargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/TargetInfo/X86TargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -23,24 +23,6 @@
   return 0;
 }
 
-static unsigned X86_32_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = X86_32_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // If the target triple is something non-X86, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  if (M.getEndianness()  == Module::LittleEndian &&
-      M.getPointerSize() == Module::Pointer32)
-    return 10;                                   // Weak match
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-
-  return 0;
-}
-
 Target llvm::TheX86_64Target;
 
 static unsigned X86_64_TripleMatchQuality(const std::string &TT) {
@@ -52,34 +34,14 @@
   return 0;
 }
 
-static unsigned X86_64_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = X86_64_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // If the target triple is something non-X86-64, we don't match.
-  if (!M.getTargetTriple().empty()) return 0;
-
-  if (M.getEndianness()  == Module::LittleEndian &&
-      M.getPointerSize() == Module::Pointer64)
-    return 10;                                   // Weak match
-  else if (M.getEndianness() != Module::AnyEndianness ||
-           M.getPointerSize() != Module::AnyPointerSize)
-    return 0;                                    // Match for some other target
-
-  return 0;
-}
-
 extern "C" void LLVMInitializeX86TargetInfo() { 
   TargetRegistry::RegisterTarget(TheX86_32Target, "x86",    
                                   "32-bit X86: Pentium-Pro and above",
                                   &X86_32_TripleMatchQuality,
-                                  &X86_32_ModuleMatchQuality,
                                   /*HasJIT=*/true);
 
   TargetRegistry::RegisterTarget(TheX86_64Target, "x86-64",    
                                   "64-bit X86: EM64T and AMD64",
                                   &X86_64_TripleMatchQuality,
-                                  &X86_64_ModuleMatchQuality,
                                   /*HasJIT=*/true);
 }

Modified: llvm/trunk/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp?rev=77114&r1=77113&r2=77114&view=diff

==============================================================================
--- llvm/trunk/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp Sat Jul 25 21:22:58 2009
@@ -21,18 +21,8 @@
   return 0;
 }
 
-static unsigned XCore_ModuleMatchQuality(const Module &M) {
-  // Check for a triple match.
-  if (unsigned Q = XCore_TripleMatchQuality(M.getTargetTriple()))
-    return Q;
-
-  // Otherwise we don't match.
-  return 0;
-}
-
 extern "C" void LLVMInitializeXCoreTargetInfo() { 
   TargetRegistry::RegisterTarget(TheXCoreTarget, "xcore",
                                   "XCore",
-                                  &XCore_TripleMatchQuality,
-                                  &XCore_ModuleMatchQuality);
+                                  &XCore_TripleMatchQuality);
 }





More information about the llvm-commits mailing list