summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveRegMatrix.cpp
diff options
context:
space:
mode:
authorPuyan Lotfi <puyan@puyan.org>2014-02-06 08:42:01 +0000
committerPuyan Lotfi <puyan@puyan.org>2014-02-06 08:42:01 +0000
commit12ae04bd17e754a458cb72df5c3e7d1816793012 (patch)
treee94be7c6afd07b323f88f5e8d87755b74d56e80d /llvm/lib/CodeGen/LiveRegMatrix.cpp
parent0743a72caac082e6fa4e12c4c830fcd1e09fae40 (diff)
downloadbcm5719-llvm-12ae04bd17e754a458cb72df5c3e7d1816793012.tar.gz
bcm5719-llvm-12ae04bd17e754a458cb72df5c3e7d1816793012.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/LiveRegMatrix.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveRegMatrix.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveRegMatrix.cpp b/llvm/lib/CodeGen/LiveRegMatrix.cpp
index 1d801ac914a..7c943786635 100644
--- a/llvm/lib/CodeGen/LiveRegMatrix.cpp
+++ b/llvm/lib/CodeGen/LiveRegMatrix.cpp
@@ -65,7 +65,9 @@ bool LiveRegMatrix::runOnMachineFunction(MachineFunction &MF) {
void LiveRegMatrix::releaseMemory() {
for (unsigned i = 0, e = Matrix.size(); i != e; ++i) {
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.
}
}
OpenPOWER on IntegriCloud