[llvm] r260723 - Get rid of some GLOBAL_ISEL ifdefs that should be harmless for code size.

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 12:41:24 PST 2016


Author: qcolombet
Date: Fri Feb 12 14:41:24 2016
New Revision: 260723

URL: http://llvm.org/viewvc/llvm-project?rev=260723&view=rev
Log:
Get rid of some GLOBAL_ISEL ifdefs that should be harmless for code size.
More to come, but those were easy.

Modified:
    llvm/trunk/include/llvm/CodeGen/Passes.h
    llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp

Modified: llvm/trunk/include/llvm/CodeGen/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=260723&r1=260722&r2=260723&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/Passes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/Passes.h Fri Feb 12 14:41:24 2016
@@ -216,11 +216,9 @@ public:
     return true;
   }
 
-#ifdef LLVM_BUILD_GLOBAL_ISEL
   /// This method should install an IR translator pass, which converts from
   /// LLVM code to machine instructions with possibly generic opcodes.
   virtual bool addIRTranslator() { return true; }
-#endif
 
   /// Add the complete, standard set of LLVM CodeGen passes.
   /// Fully developed targets will not generally override this.

Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=260723&r1=260722&r2=260723&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Fri Feb 12 14:41:24 2016
@@ -42,11 +42,9 @@ static cl::opt<cl::boolOrDefault>
 EnableFastISelOption("fast-isel", cl::Hidden,
   cl::desc("Enable the \"fast\" instruction selector"));
 
-#ifdef LLVM_BUILD_GLOBAL_ISEL
 static cl::opt<bool>
     EnableGlobalISel("global-isel", cl::Hidden, cl::init(false),
                      cl::desc("Enable the \"global\" instruction selector"));
-#endif
 
 void LLVMTargetMachine::initAsmInfo() {
   MRI = TheTarget.createMCRegInfo(getTargetTriple().str());
@@ -141,14 +139,11 @@ addPassesToGenerateCode(LLVMTargetMachin
        TM->getO0WantsFastISel()))
     TM->setFastISel(true);
 
-#ifdef LLVM_BUILD_GLOBAL_ISEL
-  if (EnableGlobalISel) {
+  // Ask the target for an isel.
+  if (LLVM_UNLIKELY(EnableGlobalISel)) {
     if (PassConfig->addIRTranslator())
       return nullptr;
-  } else
-#endif
-      // Ask the target for an isel.
-      if (PassConfig->addInstSelector())
+  } else if (PassConfig->addInstSelector())
     return nullptr;
 
   PassConfig->addMachinePasses();




More information about the llvm-commits mailing list