Commit 7724c67a authored by Tanya Lattner's avatar Tanya Lattner
Browse files

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
parent 8c2ae4c6
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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());

+5 −0
Original line number Diff line number Diff line
@@ -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;
}