This small change reduces compile time for small programs on targets that have
authorPuyan Lotfi <puyan@puyan.org>
Thu, 6 Feb 2014 08:42:01 +0000 (08:42 +0000)
committerPuyan Lotfi <puyan@puyan.org>
Thu, 6 Feb 2014 08:42:01 +0000 (08:42 +0000)
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

lib/CodeGen/LiveRegMatrix.cpp

index 1d801ac914ab0458bf089a3df74244c60ea0ee08..7c9437866357f7de71e995328bd2b652e959b0a8 100644 (file)
@@ -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.
   }
 }