This small change reduces compile time for small programs on targets that have

large register files. The omission of Queries.clear() is perfectly safe because
LiveIntervalUnion::Query doesn't contain any data that needs freeing and
because LiveRegMatrix::runOnFunction happens to reset the OwningArrayPtr
holding Queries every time it is run, so there's no need to zero out the
queries either. Not having to do this for very large numbers of physregs
is a noticeable constant cost reduction in compilation of small programs.

llvm-svn: 200913
This commit is contained in:
Puyan Lotfi 2014-02-06 08:42:01 +00:00
parent 0743a72caa
commit 12ae04bd17
1 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,9 @@ bool LiveRegMatrix::runOnMachineFunction(MachineFunction &MF) {
void LiveRegMatrix::releaseMemory() { void LiveRegMatrix::releaseMemory() {
for (unsigned i = 0, e = Matrix.size(); i != e; ++i) { for (unsigned i = 0, e = Matrix.size(); i != e; ++i) {
Matrix[i].clear(); Matrix[i].clear();
Queries[i].clear(); // No need to clear Queries here, since LiveIntervalUnion::Query doesn't
// have anything important to clear and LiveRegMatrix's runOnFunction()
// does a OwningPtr::reset anyways.
} }
} }