summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
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
commit191453174d7379540be69ac836f02db68a5becb8 (patch)
treee7849cc92b79f11165d3536ffcbfa4df68187762 /llvm/lib/Target
parentbf40eee91a4e1ee4866a94aedad563f01e253a9e (diff)
downloadbcm5719-llvm-191453174d7379540be69ac836f02db68a5becb8.tar.gz
bcm5719-llvm-191453174d7379540be69ac836f02db68a5becb8.zip
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. llvm-svn: 58144
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86TargetMachine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp
index ef4f897f5d1..2b67971d480 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud