Remove -disable-fast-isel. Use cl::boolOrDefault with -fast-isel
authorDan Gohman <gohman@apple.com>
Tue, 7 Oct 2008 23:00:56 +0000 (23:00 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 7 Oct 2008 23:00:56 +0000 (23:00 +0000)
instead.

So now: -fast-isel or -fast-isel=true enable fast-isel, and
-fast-isel=false disables it. Fast-isel is also on by default
with -fast, and off by default otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57270 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LLVMTargetMachine.cpp
test/CodeGen/X86/2008-05-21-CoalescerBug.ll

index cd444552f7ac21aaa9edf5419e97d8c92c68d43a..333b8ab9b7c2c6b748c243cb73494268b35e7bda 100644 (file)
@@ -56,12 +56,9 @@ DisablePostRAScheduler("disable-post-RA-scheduler",
 // Enable or disable FastISel. Both options are needed, because
 // FastISel is enabled by default with -fast, and we wish to be
 // able to enable or disable fast-isel independently from -fast.
-static cl::opt<bool>
+static cl::opt<cl::boolOrDefault>
 EnableFastISelOption("fast-isel", cl::Hidden,
   cl::desc("Enable the experimental \"fast\" instruction selector"));
-static cl::opt<bool>
-DisableFastISelOption("disable-fast-isel", cl::Hidden,
-  cl::desc("Disable the experimental \"fast\" instruction selector"));
 
 FileModel::Model
 LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
@@ -175,10 +172,8 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) {
   // Standard Lower-Level Passes.
 
   // Enable FastISel with -fast, but allow that to be overridden.
-  assert((!EnableFastISelOption || !DisableFastISelOption) &&
-         "Both -fast-isel and -disable-fast-isel given!");
-  if (EnableFastISelOption ||
-      (Fast && !DisableFastISelOption))
+  if (EnableFastISelOption == cl::BOU_TRUE ||
+      (Fast && EnableFastISelOption != cl::BOU_FALSE))
     EnableFastISel = true;
 
   // Ask the target for an isel.
index 666c26157ac697b0c8fcdc07f2284e8ce2eafb32..bed218fb70237959021e58acac657665e59aeda9 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -fast -disable-fast-isel | grep mov | count 5
+; RUN: llvm-as < %s | llc -march=x86 -fast -fast-isel=false | grep mov | count 5
 ; PR2343
 
        %llvm.dbg.anchor.type = type { i32, i32 }