[llvm-commits] [llvm] r123437 - /llvm/trunk/include/llvm/Support/StandardPasses.h

Chris Lattner sabre at nondot.org
Fri Jan 14 00:21:08 PST 2011


Author: lattner
Date: Fri Jan 14 02:21:08 2011
New Revision: 123437

URL: http://llvm.org/viewvc/llvm-project?rev=123437&view=rev
Log:
switch the second scalarrepl pass to use SSAUpdater.  We run two scalarrepl passes: one 
early in the cleanup code and one late interlaced with the inliner.  The second one is
important because inlining and other scalar optzns can unpin allocas, allowing them to 
be split up and promoted.  While important for performance, this is also relatively
rare, and we would previously force a (non-lazy) computation of DomFrontiers, which 
happened even if nothing became unpinned.

With this patch, the first pass of scalarrepl still promotes the vast bulk of allocas
in programs, but hte second pass has changed to use SSAUpdater, which is more "sparse"
and lazy.  This speeds up opt -O3 time on kimwitu++ (a c++ app) by about 1%.  The
numbers are interesting: the first pass promotes ~17500 allocas.  The second pass
promotes about 1600.  For non-C++ codes, the compile time win should be greater, 
because the second pass of scalarrepl does less.


Modified:
    llvm/trunk/include/llvm/Support/StandardPasses.h

Modified: llvm/trunk/include/llvm/Support/StandardPasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StandardPasses.h?rev=123437&r1=123436&r2=123437&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/StandardPasses.h (original)
+++ llvm/trunk/include/llvm/Support/StandardPasses.h Fri Jan 14 02:21:08 2011
@@ -125,7 +125,8 @@
       PM->add(createArgumentPromotionPass());   // Scalarize uninlined fn args
     
     // Start of function pass.
-    PM->add(createScalarReplAggregatesPass());  // Break up aggregate allocas
+    // Break up aggregate allocas, using SSAUpdater.
+    PM->add(createScalarReplAggregatesPass(-1, false));
     PM->add(createEarlyCSEPass());              // Catch trivial redundancies
     if (OptimizeBuiltins)
       PM->add(createSimplifyLibCallsPass());    // Library Call Optimizations





More information about the llvm-commits mailing list