aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-10-01 20:39:19 +0000
committerDan Gohman <gohman@apple.com>2008-10-01 20:39:19 +0000
commitdc756858f92a397ed30362ba8251fec56479735f (patch)
treed8f8c52691e586e58b134100c1fa410182868375 /lib/CodeGen
parent795daece23cdc66bc7c16e9a2043dd4a4d0bbfc0 (diff)
downloadexternal_llvm-dc756858f92a397ed30362ba8251fec56479735f.zip
external_llvm-dc756858f92a397ed30362ba8251fec56479735f.tar.gz
external_llvm-dc756858f92a397ed30362ba8251fec56479735f.tar.bz2
Enable FastISel by default (on x86 and x86-64) with the -fast option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 9368540..bd8d499 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -53,10 +53,15 @@ DisablePostRAScheduler("disable-post-RA-scheduler",
cl::desc("Disable scheduling after register allocation"),
cl::init(true));
-static cl::opt<bool, true>
-FastISelOption("fast-isel", cl::Hidden,
- cl::desc("Enable the experimental \"fast\" instruction selector"),
- cl::location(EnableFastISel));
+// 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>
+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,
@@ -169,6 +174,13 @@ 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))
+ EnableFastISel = true;
+
// Ask the target for an isel.
if (addInstSelector(PM, Fast))
return true;