aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-10-25 17:46:52 +0000
committerDan Gohman <gohman@apple.com>2008-10-25 17:46:52 +0000
commit71b7f646de0d9e74198534d4a7b6059e6031ed59 (patch)
tree5c087a0bd0f9048bdaa8323611a30e8363e2526e
parenta2cbe6c5b5c781a7c4125792a31d3670a777a3b7 (diff)
Move the code that adds the DeadMachineInstructionElimPass from
target-independent code to target-specific code. This prevents it from running on targets that aren't using fast-isel. In addition to saving compile time, this addresses the problem that not all targets are prepared for it. In order to use this pass, all instructions must declare all their fixed uses and defs of physical registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58144 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp4
-rw-r--r--lib/Target/X86/X86TargetMachine.cpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index fa386b00f7..ee3f604abd 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -185,10 +185,6 @@ 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/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index ef4f897f5d..2b67971d48 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -183,6 +183,11 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS,
bool X86TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
// Install an instruction selector.
PM.add(createX86ISelDag(*this, Fast));
+
+ // If we're using Fast-ISel, clean up the mess.
+ if (EnableFastISel)
+ PM.add(createDeadMachineInstructionElimPass());
+
return false;
}