aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-25 01:14:49 +0000
committerDan Gohman <gohman@apple.com>2008-09-25 01:14:49 +0000
commit2c4bf119be8aa05cdc3dc88c57006353f07f0d2c (patch)
tree10e1312b06ede6ffe8a5d225658dd177d8ac2536 /lib/CodeGen
parent723ac3720f6d983e0ed01504964fde1aa63951ff (diff)
Enable DeadMachineInstructionElim when Fast-ISel is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp13
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp3
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 60925f31dd..9368540136 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -25,6 +25,10 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+namespace llvm {
+ bool EnableFastISel;
+}
+
static cl::opt<bool> PrintLSR("print-lsr-output", cl::Hidden,
cl::desc("Print LLVM IR produced by the loop-reduce pass"));
static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden,
@@ -49,6 +53,11 @@ 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));
+
FileModel::Model
LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
raw_ostream &Out,
@@ -168,6 +177,10 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) {
if (PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(cerr));
+ // If we're using Fast-ISel, clean up the mess.
+ if (EnableFastISel)
+ PM.add(createDeadMachineInstructionElimPass());
+
if (EnableLICM)
PM.add(createMachineLICMPass());
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index afb290d822..9e12a272ad 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -56,9 +56,6 @@ EnableValueProp("enable-value-prop", cl::Hidden);
static cl::opt<bool>
EnableLegalizeTypes("enable-legalize-types", cl::Hidden);
static cl::opt<bool>
-EnableFastISel("fast-isel", cl::Hidden,
- cl::desc("Enable the experimental \"fast\" instruction selector"));
-static cl::opt<bool>
EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,
cl::desc("Enable verbose messages in the experimental \"fast\" "
"instruction selector"));