CodeGen: Use a single SlotTracker in MachineFunction::print()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 26 Jun 2015 22:04:20 +0000 (22:04 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 26 Jun 2015 22:04:20 +0000 (22:04 +0000)
commit3269215401427b28457128b1833e15d21dd70257
tree8ec3ea69a6878711210110ed76b414fcc46c16b3
parent4694ed0a1456d30c8eacd56d024afabe53cfd0f8
CodeGen: Use a single SlotTracker in MachineFunction::print()

Expose enough of the IR-level `SlotTracker` so that
`MachineFunction::print()` can use a single one for printing
`BasicBlock`s.  Next step would be to lift this through a few more APIs
so that we can make other print methods faster.

Fixes PR23865, changing the runtime of `llc -print-machineinstrs` from
many minutes (killed after 3 minutes, but it wasn't very close) to
13 seconds for a 502185 line dump.

llvm-svn: 240842
llvm/include/llvm/CodeGen/MachineBasicBlock.h
llvm/include/llvm/IR/ModuleSlotTracker.h [new file with mode: 0644]
llvm/include/llvm/IR/Value.h
llvm/lib/CodeGen/MachineBasicBlock.cpp
llvm/lib/CodeGen/MachineFunction.cpp
llvm/lib/IR/AsmWriter.cpp