[llvm] r322800 - Fix the failure caused by r322773

Volkan Keles via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 17:10:30 PST 2018


Author: volkan
Date: Wed Jan 17 17:10:30 2018
New Revision: 322800

URL: http://llvm.org/viewvc/llvm-project?rev=322800&view=rev
Log:
Fix the failure caused by r322773

Do not run GlobalISel if `-fast-isel=0 -global-isel=false`.

Modified:
    llvm/trunk/lib/CodeGen/TargetPassConfig.cpp
    llvm/trunk/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll

Modified: llvm/trunk/lib/CodeGen/TargetPassConfig.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetPassConfig.cpp?rev=322800&r1=322799&r2=322800&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetPassConfig.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetPassConfig.cpp Wed Jan 17 17:10:30 2018
@@ -711,16 +711,11 @@ bool TargetPassConfig::addCoreISelPasses
     TM->setFastISel(true);
 
   // Ask the target for an instruction selector.
-  bool EnableGlobalISel = TM->Options.EnableGlobalISel;
   // Explicitly enabling fast-isel should override implicitly enabled
   // global-isel.
-  if (EnableGlobalISel && (EnableGlobalISelOption == cl::BOU_UNSET) &&
-      (EnableFastISelOption == cl::BOU_TRUE))
-    EnableGlobalISel = false;
-  if (EnableGlobalISelOption == cl::BOU_TRUE)
-    EnableGlobalISel = true;
-
-  if (EnableGlobalISel) {
+  if (EnableGlobalISelOption == cl::BOU_TRUE ||
+      (EnableGlobalISelOption == cl::BOU_UNSET &&
+       TM->Options.EnableGlobalISel && EnableFastISelOption != cl::BOU_TRUE)) {
     if (addIRTranslator())
       return true;
 

Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll?rev=322800&r1=322799&r2=322800&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll Wed Jan 17 17:10:30 2018
@@ -32,6 +32,9 @@
 ; RUN: llc -mtriple=aarch64-- -debug-pass=Structure %s -o /dev/null 2>&1 \
 ; RUN:   | FileCheck %s --check-prefix DISABLED
 
+; RUN: llc -mtriple=aarch64-- -fast-isel=0 -global-isel=false \
+; RUN: -debug-pass=Structure %s -o /dev/null 2>&1 | FileCheck %s --check-prefix DISABLED
+
 ; ENABLED:       IRTranslator
 ; ENABLED-NEXT:  Legalizer
 ; ENABLED-NEXT:  RegBankSelect




More information about the llvm-commits mailing list