[llvm-commits] [llvm] r56604 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Dan Gohman
gohman at apple.com
Wed Sep 24 18:14:53 PDT 2008
Author: djg
Date: Wed Sep 24 20:14:49 2008
New Revision: 56604
URL: http://llvm.org/viewvc/llvm-project?rev=56604&view=rev
Log:
Enable DeadMachineInstructionElim when Fast-ISel is enabled.
Modified:
llvm/trunk/include/llvm/Target/TargetOptions.h
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/include/llvm/Target/TargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=56604&r1=56603&r2=56604&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetOptions.h (original)
+++ llvm/trunk/include/llvm/Target/TargetOptions.h Wed Sep 24 20:14:49 2008
@@ -101,6 +101,12 @@
/// DisableJumpTables - This flag indicates jump tables should not be
/// generated.
extern bool DisableJumpTables;
+
+ /// FastISel - This flag enables fast-path instruction selection
+ /// which trades away generated code quality in favor of reducing
+ /// compile time.
+ extern bool EnableFastISel;
+
} // End llvm namespace
#endif
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=56604&r1=56603&r2=56604&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Sep 24 20:14:49 2008
@@ -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 @@
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 @@
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());
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=56604&r1=56603&r2=56604&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Sep 24 20:14:49 2008
@@ -56,9 +56,6 @@
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"));
More information about the llvm-commits
mailing list