[llvm] r200913 - This small change reduces compile time for small programs on targets that have

Puyan Lotfi puyan at puyan.org
Thu Feb 6 00:42:01 PST 2014


Author: zer0
Date: Thu Feb  6 02:42:01 2014
New Revision: 200913

URL: http://llvm.org/viewvc/llvm-project?rev=200913&view=rev
Log:
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.


Modified:
    llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp

Modified: llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp?rev=200913&r1=200912&r2=200913&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp Thu Feb  6 02:42:01 2014
@@ -65,7 +65,9 @@ bool LiveRegMatrix::runOnMachineFunction
 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.
   }
 }
 





More information about the llvm-commits mailing list