From reid at x10sys.com Mon Feb 5 00:10:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 5 Feb 2007 00:10:35 -0600 Subject: [llvm-commits] CVS: llvm/utils/findmisopt Message-ID: <200702050610.l156AZ4i005329@zion.cs.uiuc.edu> Changes in directory llvm/utils: findmisopt updated: 1.11 -> 1.12 --- Log message: Use opt to generate the list of passes to run. --- Diffs of the changes: (+5 -5) findmisopt | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/utils/findmisopt diff -u llvm/utils/findmisopt:1.11 llvm/utils/findmisopt:1.12 --- llvm/utils/findmisopt:1.11 Fri Dec 8 22:42:33 2006 +++ llvm/utils/findmisopt Mon Feb 5 00:10:19 2007 @@ -93,11 +93,11 @@ ex1=$? # Define the list of optimizations to run. This comprises the same set of -# optimizations that gccas and gccld run, in the same order. -all_switches="-verify -lowersetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -raise -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge -funcresolve -internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplifycfg -verify" -# Here's an alternative list of optimizations comprising just the ones that -# gccld uses. To use, just comment out the line above, and uncomment this one -#all_switches="-funcresolve -internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplifycfg -verify" +# optimizations that opt -std-compile-opts and gccld run, in the same order. +opt_switches=`llvm-as < /dev/null -o - | opt -std-compile-opts -disable-output -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'` +gccld_switches="-internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplifycfg -verify" +all_switches="$opt_switches $gccld_switches" +echo "Passes : $all_switches" # Current set of switches is empty function tryit { From sabre at nondot.org Mon Feb 5 00:31:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 5 Feb 2007 00:31:07 -0600 Subject: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html Message-ID: <200702050631.l156V7I5005726@zion.cs.uiuc.edu> Changes in directory llvm/docs: ProgrammersManual.html updated: 1.120 -> 1.121 --- Log message: add a note --- Diffs of the changes: (+28 -1) ProgrammersManual.html | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletion(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.120 llvm/docs/ProgrammersManual.html:1.121 --- llvm/docs/ProgrammersManual.html:1.120 Sat Feb 3 18:00:26 2007 +++ llvm/docs/ProgrammersManual.html Mon Feb 5 00:30:51 2007 @@ -797,6 +797,33 @@ itself (which would waste space for elements that aren't in the container). vector is also useful when interfacing with code that expects vectors :).
+ +One worthwhile note about std::vector: avoid code like this:
+ +
+for ( ... ) {
+ std::vector V;
+ use V;
+}
+
+Instead, write this as:
+ ++std::vector+V; +for ( ... ) { + use V; + V.clear(); +} +
Doing so will save (at least) one heap allocation and free per iteration of +the loop.
+ @@ -3170,7 +3197,7 @@ Dinakar Dhurjati and Chris Lattner