diff options
author | Puyan Lotfi <puyan@puyan.org> | 2014-02-06 08:42:01 +0000 |
---|---|---|
committer | Puyan Lotfi <puyan@puyan.org> | 2014-02-06 08:42:01 +0000 |
commit | f15735e03989d441b1b2102d5bf9c34d2b5a24d8 (patch) | |
tree | cb3acc0e1597c3fe7d02ba06d20cbead86f2ec1f /lib/CodeGen/LiveRegMatrix.cpp | |
parent | 44e40408eebdd38831501fc2fab59d550e951808 (diff) | |
download | llvm-f15735e03989d441b1b2102d5bf9c34d2b5a24d8.tar.gz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveRegMatrix.cpp')
-rw-r--r-- | lib/CodeGen/LiveRegMatrix.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveRegMatrix.cpp b/lib/CodeGen/LiveRegMatrix.cpp index 1d801ac914ab..7c9437866357 100644 --- a/lib/CodeGen/LiveRegMatrix.cpp +++ b/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. } } |