[llvm-commits] [poolalloc] r106807 - in /poolalloc/trunk/test: Makefile TEST.dsaa.Makefile TEST.dsaa.report

Will Dietz wdietz2 at illinois.edu
Thu Jun 24 16:32:57 PDT 2010


Author: wdietz2
Date: Thu Jun 24 18:32:56 2010
New Revision: 106807

URL: http://llvm.org/viewvc/llvm-project?rev=106807&view=rev
Log:
added ds-aa tests

Added:
    poolalloc/trunk/test/TEST.dsaa.Makefile
    poolalloc/trunk/test/TEST.dsaa.report
Modified:
    poolalloc/trunk/test/Makefile

Modified: poolalloc/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=106807&r1=106806&r2=106807&view=diff
==============================================================================
--- poolalloc/trunk/test/Makefile (original)
+++ poolalloc/trunk/test/Makefile Thu Jun 24 18:32:56 2010
@@ -39,10 +39,10 @@
 
 
 NORMAL_PROBLEM_SIZE_DIRS := \
-   MultiSource/Benchmarks/Olden/bh \
-   #MultiSource/Benchmarks/Olden \
+   MultiSource/Benchmarks/Olden \
+   External/SPEC/CINT2000 \
+   #MultiSource/Benchmarks/Olden/bh \
    #External/SPEC/CINT2000/175.vpr \
-   #External/SPEC/CINT2000 \
    #External/SPEC/CINT2000/181.mcf \
    #External/SPEC/CINT2000/186.crafty \
    #External/FPGrowth \
@@ -112,6 +112,30 @@
         done
 	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
 
+# Program tests for DSAA
+progdsaa::
+	for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \
+            (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=dsaa \
+                   LARGE_PROBLEM_SIZE=1 report.html) \
+        done
+	for dir in $(NORMAL_PROBLEM_SIZE_DIRS); do \
+	    (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=dsaa \
+                   report.html) \
+        done
+	@for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \
+            (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -s -j1 TEST=dsaa \
+                   LARGE_PROBLEM_SIZE=1 report) \
+        done
+	@for dir in $(NORMAL_PROBLEM_SIZE_DIRS); do \
+	    (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -s -j1 TEST=dsaa \
+                   report) \
+        done
+	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
+
 # Program tests for the allocator
 progalloc::
 	for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \

Added: poolalloc/trunk/test/TEST.dsaa.Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.dsaa.Makefile?rev=106807&view=auto
==============================================================================
--- poolalloc/trunk/test/TEST.dsaa.Makefile (added)
+++ poolalloc/trunk/test/TEST.dsaa.Makefile Thu Jun 24 18:32:56 2010
@@ -0,0 +1,154 @@
+##===- poolalloc/test/TEST.dsaa.Makefile -------------------*- Makefile -*-===##
+#
+# This test runs ds-aa on all of the Programs, producing some
+# performance numbers and statistics.
+#
+##===----------------------------------------------------------------------===##
+
+
+#CFLAGS += -O2 -fno-strict-aliasing
+CFLAGS += -O0 -fno-strict-aliasing
+
+CURDIR  := $(shell cd .; pwd)
+PROGDIR := $(shell cd $(LLVM_SRC_ROOT)/projects/test-suite; pwd)/
+RELDIR  := $(subst $(PROGDIR),,$(CURDIR))
+#PADIR   := /home/andrewl/Research/llvm/projects/poolalloc
+PADIR   := $(LLVM_OBJ_ROOT)/projects/poolalloc
+
+# Bits of runtime to improve analysis
+PA_PRE_RT := $(PADIR)/$(CONFIGURATION)/lib/libpa_pre_rt.bca
+
+# DSA pass shared object
+DSA_SO   := $(PADIR)/$(CONFIGURATION)/lib/libLLVMDataStructure$(SHLIBEXT)
+
+# Command to run opt with the ds-aa pass loaded
+OPT_PA := $(LOPT) -load $(DSA_SO)
+
+# OPT_PA_STATS - Run opt with the -stats and -time-passes options, capturing the
+# output to a file.
+OPT_PA_STATS = $(OPT_PA) -info-output-file=$(CURDIR)/$@.info -stats -time-passes
+
+#All llvm 2.7 -O3 passes
+OPTZN_PASSES := -preverify -domtree -verify -lowersetjmp -globalopt -ipsccp -deadargelim -instcombine -simplifycfg -basiccg -prune-eh -inline -functionattrs -argpromotion -domtree -domfrontier -scalarrepl -simplify-libcalls -instcombine -jump-threading -simplifycfg -instcombine -tailcallelim -simplifycfg -reassociate -domtree -loops -loopsimplify -domfrontier -loopsimplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loopsimplify -lcssa -iv-users -indvars -loop-deletion -loopsimplify -lcssa -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp -instcombine -jump-threading -domtree -memdep -dse -adce -simplifycfg -strip-dead-prototypes -print-used-types -deadtypeelim -globaldce -constmerge -preverify -domtree -verify
+
+#-ds-aa -opt1 -ds-aa -opt2, etc
+#this forces each pass to use -ds-aa as it's AA if it would use one
+AA_OPT = $(addprefix -ds-aa ,$(OPTZN_PASSES))
+
+## Set of passes to run before -ds-aa
+#BASE_OPT_PASSES := -instnamer -internalize -indclone -funcspec -ipsccp -deadargelim -instcombine -globaldce 
+BASE_OPT_PASSES := -disable-opt
+
+$(PROGRAMS_TO_TEST:%=Output/%.temp.bc): \
+Output/%.temp.bc: Output/%.llvm.bc 
+	-$(LLVMLD) -link-as-library $< $(PA_PRE_RT) -o $@
+
+$(PROGRAMS_TO_TEST:%=Output/%.base.bc): \
+Output/%.base.bc: Output/%.temp.bc $(LOPT)
+	-$(LOPT) $(BASE_OPT_PASSES) -stats $< -f -o $@ 
+
+#LLVM with all opts
+$(PROGRAMS_TO_TEST:%=Output/%.llvmopt.bc): \
+Output/%.llvmopt.bc: Output/%.base.bc $(PA_SO) $(LOPT)
+	- at rm -f $(CURDIR)/$@.info
+	-$(OPT_PA_STATS) $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out
+
+#DSA --run all opts, having them make use of -ds-aa
+$(PROGRAMS_TO_TEST:%=Output/%.dsaopt.bc): \
+Output/%.dsaopt.bc: Output/%.base.bc $(LOPT)
+	- at rm -f $(CURDIR)/$@.info
+	-$(OPT_PA_STATS) $(AA_OPT) $< -o $@ -f 2>&1 > $@.out
+
+# This rule compiles the new .bc file into a .s file
+Output/%.s: Output/%.bc $(LLC)
+	-$(LLC) -f $< -o $@
+
+Output/%: Output/%.s $(PA_RT_O)
+	-$(CC) $(CFLAGS) $< $(PA_RT_O) $(LLCLIBS) $(LDFLAGS) -o $@
+
+
+ifndef PROGRAMS_HAVE_CUSTOM_RUN_RULES
+
+# This rule runs the generated executable, generating timing information, for
+# normal test programs
+$(PROGRAMS_TO_TEST:%=Output/%.llvmopt.out): \
+Output/%.llvmopt.out: Output/%.llvmopt
+	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+
+$(PROGRAMS_TO_TEST:%=Output/%.dsaopt.out): \
+Output/%.dsaopt.out: Output/%.dsaopt
+	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+else
+
+# This rule runs the generated executable, generating timing information, for
+# SPEC
+$(PROGRAMS_TO_TEST:%=Output/%.llvmopt.out): \
+Output/%.llvmopt.out: Output/%.llvmopt
+	-$(SPEC_SANDBOX) dsa-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+             $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+                  ../../$< $(RUN_OPTIONS)
+	-(cd Output/dsa-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-cp Output/dsa-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+
+$(PROGRAMS_TO_TEST:%=Output/%.dsaopt.out): \
+Output/%.dsaopt.out: Output/%.dsaopt
+	-$(SPEC_SANDBOX) dsaopt-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+             $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+                  ../../$< $(RUN_OPTIONS)
+	-(cd Output/dsaopt-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-cp Output/dsaopt-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+
+endif
+
+
+#Diff llvm's optimized vs gcc, as well as ds-aa optimized vs gcc
+$(PROGRAMS_TO_TEST:%=Output/%.llvmopt.diff-nat): \
+Output/%.llvmopt.diff-nat: Output/%.out-nat Output/%.llvmopt.out
+	@cp Output/$*.out-nat Output/$*.llvmopt.out-nat
+	-$(DIFFPROG) nat $*.llvmopt $(HIDEDIFF)
+
+$(PROGRAMS_TO_TEST:%=Output/%.dsaopt.diff-nat): \
+Output/%.dsaopt.diff-nat: Output/%.out-nat Output/%.dsaopt.out
+	@cp Output/$*.out-nat Output/$*.dsaopt.out-nat
+	-$(DIFFPROG) nat $*.dsaopt $(HIDEDIFF)
+
+
+# This rule wraps everything together to build the actual output the report is
+# generated from.
+$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
+Output/%.$(TEST).report.txt: Output/%.out-nat                \
+                             Output/%.dsaopt.diff-nat         \
+			     Output/%.llvmopt.diff-nat     \
+                             Output/%.LOC.txt
+	@-cat $<
+	@echo > $@
+	@echo "---------------------------------------------------------------" >> $@
+	@echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
+	@echo "---------------------------------------------------------------" >> $@
+	@echo >> $@
+	@-if test -f Output/$*.dsaopt.diff-nat; then \
+	  printf "GCC-RUN-TIME: " >> $@;\
+	  grep "^program" Output/$*.out-nat.time >> $@;\
+        fi
+	@-if test -f Output/$*.llvmopt.diff-nat; then \
+	  printf "RUN-TIME-LLVMOPT: " >> $@;\
+	  grep "^program" Output/$*.llvmopt.out.time >> $@;\
+        fi
+	@-if test -f Output/$*.dsaopt.diff-nat; then \
+	  printf "RUN-TIME-DSAAOPT: " >> $@;\
+	  grep "^program" Output/$*.dsaopt.out.time >> $@;\
+	fi
+	-printf "LOC: " >> $@
+	-cat Output/$*.LOC.txt >> $@
+	@-cat Output/$*.$(TEST).bc.info >> $@
+	@#cat Output/$*.$(TEST).basepa.bc.out  >> $@
+
+
+$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+test.$(TEST).%: Output/%.$(TEST).report.txt
+	@echo "---------------------------------------------------------------"
+	@echo ">>> ========= '$(RELDIR)/$*' Program"
+	@echo "---------------------------------------------------------------"
+	@-cat $<
+
+REPORT_DEPENDENCIES := $(PA_RT_O) $(PA_SO) $(PROGRAMS_TO_TEST:%=Output/%.llvm.bc) $(LLC) $(LOPT)

Added: poolalloc/trunk/test/TEST.dsaa.report
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.dsaa.report?rev=106807&view=auto
==============================================================================
--- poolalloc/trunk/test/TEST.dsaa.report (added)
+++ poolalloc/trunk/test/TEST.dsaa.report Thu Jun 24 18:32:56 2010
@@ -0,0 +1,101 @@
+##=== TEST.dsaa.report - Report description for poolalloc ------*- perl -*-===##
+#
+# This file defines a report to be generated for the dsaa tests.
+#
+##===----------------------------------------------------------------------===##
+
+# Sort by program name
+$SortCol = 0;
+$TrimRepeatedPrefix = 1;
+
+# FormatTime - Convert a time from 1m23.45 into 83.45
+sub FormatTime {
+  my $Time = shift;
+  if ($Time =~ m/([0-9]+)[m:]([0-9.]+)/) {
+    return sprintf("%7.3f", $1*60.0+$2);
+  }
+
+  return sprintf("%6.2f", $Time);
+}
+
+
+sub RuntimePercent {
+  my ($Cols, $Col) = @_;
+  if ($Cols->[$Col-1] ne "*" and $Cols->[3] ne "*" and
+      $Cols->[3] != "0") {
+    return sprintf "%7.2f", 100*$Cols->[$Col-1]/$Cols->[3];
+  } else {
+    return "n/a";
+  }
+}
+
+ at LatexColumns = (1, 5, 8, 12, 9, 13, 14, 15, 2, 16);
+
+my $FREEBENCH = 'MultiSource/Benchmarks/FreeBench';
+my $PTRDIST   = 'MultiSource/Benchmarks/Ptrdist';
+
+ at LatexRowMapOrder = (
+                     '164.gzip/164.gzip' => '164.gzip',
+                     '175.vpr/175.vpr' => '175.vpr',
+                     '181.mcf/181.mcf' => '181.mcf',
+                     '186.crafty/186.crafty' => '186.crafty',
+                     '197.parser/197.parser' => '197.parser',
+                     '197.parser.hacked/197.parser.hacked' => '197.parser(b)',
+                     '255.vortex/255.vortex' => '255.vortex',
+                     '256.bzip2/256.bzip2' => '256.bzip2',
+                     '300.twolf/300.twolf' => '300.twolf',
+                     '-' => '-',
+                     "anagram/anagram"       => 'anagram',
+                     "bc/bc"                 => 'bc',
+                     "ft/ft"                 => 'ft',
+                     "ks/ks"                 => 'ks',
+                     "yacr2/yacr2"           => 'yacr2',
+                     '-' => '-',
+                     "analyzer"     => 'analyzer',
+                     "neural"       => 'neural',
+                     "pcompress2"   => 'pcompress2',
+                     "piff2"        => 'piff2',
+                     '-' => '-',
+                     "bh/bh" => 'bh',
+                     "bisort/bisort" => 'bisort',
+                     "em3d/em3d" => 'em3d',
+                     "health/health" => 'health',
+                     "mst/mst" => 'mst',
+                     "perimeter/perimeter" => 'perimeter',
+                     "power/power" => 'power',
+                     "treeadd/treeadd" => 'treeadd',
+                     "tsp/tsp" => 'tsp',
+                     '-' => '-',
+                     "llu"          => 'llu-bench',
+                  );
+
+
+# These are the columns for the report.  The first entry is the header for the
+# column, the second is the regex to use to match the value.  Empty list create
+# seperators, and closures may be put in for custom processing.
+(
+# Name
+ ["Name:" , '\'([^\']+)\' Program'],
+ ["LOC"   , 'LOC:\s*([0-9]+)'],
+ [],
+# Times
+ ["GCC",            'GCC-RUN-TIME: program\s*([.0-9m:]+)', \&FormatTime],
+ ["LLVMOptTime",      'RUN-TIME-LLVMOPT: program\s*([.0-9m:]+)', \&FormatTime],
+ ["LLVMOpt run%",        \&RuntimePercent],
+ [],
+ ["DSA Time",        'RUN-TIME-DSAA: program\s*([.0-9m:]+)', \&FormatTime],
+ ["DSA run%",        \&RuntimePercent],
+# [],
+# ["NoAlias",        'no alias responses[^0-9]*([0-9]*\.[0-9]*)'],
+# ["MayAlias",        'may alias responses[^0-9]*([0-9]*\.[0-9]*)'],
+# ["MustAlias",        'must alias responses[^0-9]*([0-9]*\.[0-9]*)'],
+#["NumPools",       '([0-9]+).*Number of pools allocated'],
+#["Typesafe",       '([0-9]+).*Number of typesafe pools'],
+#["BumpPtr",        '([0-9]+).*Number of bump pointer pools'],
+#["PFE",            '([0-9]+).*Number of poolfree.s elided'],
+#["NumArgs",        '([0-9]+).*Number of function arguments added'],
+#["MaxArgs",        '([0-9]+).*Maximum function arguments added'],
+#["Nonprofit",      '([0-9]+).*Number of DSNodes not profitable'],
+ []
+);
+





More information about the llvm-commits mailing list