summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-10-30 06:06:32 +0000
committerTanya Lattner <tonic@nondot.org>2008-10-30 06:06:32 +0000
commit7724c67a1f3ffee2d6a5efce7853e07383c247bc (patch)
tree3baa5864ea216b0c4df4325b6a93d0973022761e
parent8c2ae4c603e78784c1e4887b39f6e12f01017cf7 (diff)
downloadllvm-7724c67a1f3ffee2d6a5efce7853e07383c247bc.tar.gz
Merge from mainline.
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: 58425
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp4
-rw-r--r--llvm/lib/Target/X86/X86TargetMachine.cpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index cd444552f7ac..662f1eb377b7 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -189,10 +189,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/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp
index 860868adf16a..33755ba2f0c8 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.cpp
+++ b/llvm/lib/Target/X86/X86TargetMachine.cpp
@@ -174,6 +174,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;
}