[llvm-commits] [poolalloc] r125698 - in /poolalloc/trunk/test: Makefile TEST.types.Makefile TEST.types.report

Arushi Aggarwal aggarwa4 at illinois.edu
Wed Feb 16 17:06:36 PST 2011


Author: aggarwa4
Date: Wed Feb 16 19:06:36 2011
New Revision: 125698

URL: http://llvm.org/viewvc/llvm-project?rev=125698&view=rev
Log:
Adding tests for type inference testing.

Added:
    poolalloc/trunk/test/TEST.types.Makefile   (with props)
    poolalloc/trunk/test/TEST.types.report   (with props)
Modified:
    poolalloc/trunk/test/Makefile

Modified: poolalloc/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=125698&r1=125697&r2=125698&view=diff
==============================================================================
--- poolalloc/trunk/test/Makefile (original)
+++ poolalloc/trunk/test/Makefile Wed Feb 16 19:06:36 2011
@@ -308,6 +308,30 @@
         done
 	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
 
+# Program tests for Types
+progtypes::
+	for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \
+            (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=types \
+                   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=types \
+                   report.html) \
+        done
+	@for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \
+            (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -s -j1 TEST=types \
+                   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=types \
+                   report) \
+        done
+	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
+
 
 ##############################################################################
 # Targets for running tests and gathering statistics for arbitrary tests

Added: poolalloc/trunk/test/TEST.types.Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.types.Makefile?rev=125698&view=auto
==============================================================================
--- poolalloc/trunk/test/TEST.types.Makefile (added)
+++ poolalloc/trunk/test/TEST.types.Makefile Wed Feb 16 19:06:36 2011
@@ -0,0 +1,147 @@
+##===- TEST.dsgraph.Makefile -------------------------------*- Makefile -*-===##
+#
+# This recursively traverses the programs, computing DSGraphs for each of the
+# programs in the testsuite.
+#
+##===----------------------------------------------------------------------===##
+
+RELDIR  := $(subst $(PROJ_OBJ_ROOT),,$(PROJ_OBJ_DIR))
+
+# We require the programs to be linked with libdummy
+#include $(LEVEL)/Makefile.dummylib
+
+# Pathname to poolalloc object tree
+PADIR   := $(LLVM_OBJ_ROOT)/projects/poolalloc
+
+# Pathame to the DSA pass dynamic library
+DSA_SO   := $(PADIR)/$(CONFIGURATION)/lib/libLLVMDataStructure$(SHLIBEXT)
+ASSIST_SO := $(PADIR)/$(CONFIGURATION)/lib/libAssistDS$(SHLIBEXT)
+
+# Command for running the opt program
+RUNOPT := $(RUNTOOLSAFELY) $(LLVM_OBJ_ROOT)/projects/poolalloc/$(CONFIGURATION)/bin/watchdog $(LOPT) -load $(DSA_SO)
+
+# PASS - The dsgraph pass to run: ds, bu, td
+PASS := td
+
+ANALYZE_OPTS := -stats -time-passes -disable-output -dsstats
+#ANALYZE_OPTS := -stats -time-passes -dsstats 
+ANALYZE_OPTS +=  -instcount -disable-verify 
+MEM := -track-memory -time-passes -disable-output
+
+SAFE_OPTS := -internalize -scalarrepl -deadargelim -globaldce -basiccg -inline 
+
+$(PROGRAMS_TO_TEST:%=Output/%.linked1.bc): \
+Output/%.linked1.bc: Output/%.linked.rbc $(LOPT)
+	-$(RUNOPT) -disable-opt $(SAFE_OPTS) -info-output-file=$(CURDIR)/$@.info -stats -time-passes $< -f -o $@ 
+
+$(PROGRAMS_TO_TEST:%=Output/%.llvm1.bc): \
+Output/%.llvm1.bc: Output/%.linked1.bc $(LLVM_LDDPROG)
+	-$(RUNTOOLSAFELY) $(LLVMLD) -disable-opt $(SAFE_OPTS) -info-output-file=$(CURDIR)/$@.info -stats -time-passes  $(LLVMLD_FLAGS) $< -lc $(LIBS) -o Output/$*.llvm1
+
+$(PROGRAMS_TO_TEST:%=Output/%.opt.bc): \
+Output/%.opt.bc: Output/%.llvm1.bc $(LOPT) $(ASSIST_SO)
+	-$(RUNOPT) -load $(ASSIST_SO) -disable-opt -info-output-file=$(CURDIR)/$@.info -instnamer -internalize  -varargsfunc -indclone -funcspec -ipsccp -deadargelim  -mergegep -die -globaldce -stats -time-passes $< -f -o $@ 
+
+$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
+Output/%.$(TEST).report.txt: Output/%.opt.bc Output/%.LOC.txt $(LOPT)
+	@# Gather data
+	-($(RUNOPT) -dsa-$(PASS) -enable-type-inference-opts -dsa-stdlib-no-fold $(ANALYZE_OPTS) $<)> $@.time.1 2>&1
+	-($(RUNOPT) -dsa-$(PASS) $(ANALYZE_OPTS) $<)> $@.time.2 2>&1
+	@# Emit data.
+	@echo "---------------------------------------------------------------" > $@
+	@echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
+	@echo "---------------------------------------------------------------" >> $@
+	@/bin/echo -n "LOC: " >> $@
+	@cat Output/$*.LOC.txt >> $@
+	@echo >> $@
+	@/bin/echo -n "MEMINSTS: " >> $@
+	- at grep 'Number of memory instructions' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "FOLDEDNODES: " >> $@
+	- at grep 'Number of nodes completely folded' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "TOTALNODES: " >> $@
+	- at grep 'Number of nodes allocated' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "MAXGRAPHSIZE: " >> $@
+	- at grep 'Maximum graph size' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "GLOBALSGRAPH: " >> $@
+	- at grep 'td.GlobalsGraph.dot' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "SCCSIZE: " >> $@
+	- at grep 'Maximum SCC Size in Call Graph' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES TYPED_O: " >> $@
+	- at grep 'Number of loads/stores which are fully typed' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES UNTYPED_O: " >> $@
+	- at grep 'Number of loads/stores which are untyped' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES TYPED: " >> $@
+	- at grep 'Number of loads/stores which are fully typed' $@.time.2 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES UNTYPED: " >> $@
+	- at grep 'Number of loads/stores which are untyped' $@.time.2 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES TYPED1: " >> $@
+	- at grep 'Number of loads/stores which are access a DSNode with 1 type' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES TYPED2: " >> $@
+	- at grep 'Number of loads/stores which are access a DSNode with 2 type' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES TYPED3: " >> $@
+	- at grep 'Number of loads/stores which are access a DSNode with 3 type' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES TYPED4: " >> $@
+	- at grep 'Number of loads/stores which are access a DSNode with >3 type' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES I: " >> $@
+	- at grep 'Number of loads/stores which are on incomplete nodes' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES E: " >> $@
+	- at grep 'Number of loads/stores which are on external nodes' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "ACCESSES U: " >> $@
+	- at grep 'Number of loads/stores which are on unknown nodes' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "STD_LIB_FOLD: " >> $@
+	- at grep 'Number of nodes folded in std lib' $@.time.1 >> $@
+	@echo >> $@
+	@# Emit timing data.
+	@/bin/echo -n "TIME: " >> $@
+	- at grep '  Local Data Structure' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "TIME: " >> $@
+	- at grep '  Bottom-up Data Structure' $@.time.1 >> $@
+	@echo >> $@
+	@/bin/echo -n "TIME: " >> $@
+	- at grep '  Top-down Data Structure' $@.time.1 >> $@
+	@echo >> $@
+	@# Emit AssistDS stats
+	@/bin/echo -n "CLONED_FUNCSPEC: " >> $@
+	- at grep 'Number of Functions Cloned in FuncSpec' $<.info >> $@
+	@echo >> $@
+	@/bin/echo -n "CLONED_INDCLONE: " >> $@
+	- at grep 'Number of Functions Cloned in IndClone' $<.info >> $@
+	@echo >> $@
+	@/bin/echo -n "VARARGS_CALLS: " >> $@
+	- at grep 'Number of Calls Simplified' $<.info >> $@
+	@echo >> $@
+	@/bin/echo -n "CALLS1: " >> $@
+	- at grep 'Number of calls that could not be resolved' $@.time.1 >> $@
+	@echo >> $@
+
+
+$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+test.$(TEST).%: Output/%.$(TEST).report.txt
+	@echo "---------------------------------------------------------------"
+	@echo ">>> ========= '$(RELDIR)/$*' Program"
+	@echo "---------------------------------------------------------------"
+	@cat $<
+
+# Define REPORT_DEPENDENCIES so that the report is regenerated if analyze or
+# dummylib is updated.
+#
+REPORT_DEPENDENCIES := $(DUMMYLIB) $(LOPT)
+

Propchange: poolalloc/trunk/test/TEST.types.Makefile
------------------------------------------------------------------------------
    svn:executable = *

Added: poolalloc/trunk/test/TEST.types.report
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.types.report?rev=125698&view=auto
==============================================================================
--- poolalloc/trunk/test/TEST.types.report (added)
+++ poolalloc/trunk/test/TEST.types.report Wed Feb 16 19:06:36 2011
@@ -0,0 +1,167 @@
+##=== TEST.dsgraph.report - Report description for dsgraph -----*- perl -*-===##
+#
+# This file defines a report to be generated for the dsgraph test.
+#
+##===----------------------------------------------------------------------===##
+
+$SortNumeric = 1;               # Sort numerically, not textually.
+$TrimAllDirectories = 1;        # Trim off benchmark directories.
+$SortCol = 2;                   # Sort by #MemInstrs
+$SortReverse = 1;               # Sort in descending order
+
+
+# Helper function
+sub Ratio {
+  my ($Cols, $Col) = @_;
+  if ($Cols->[$Col-2] ne "*" and
+      $Cols->[$Col-2] != "0") {
+    return $Cols->[$Col-1]/$Cols->[$Col-2];
+  } else {
+    return "n/a";
+  }
+}
+
+sub TypeSafeRatio {
+  my ($Cols, $Col) = @_;
+  my $TS = $Cols->[$Col-2];
+  my $NTS = $Cols->[$Col-1];
+  $TS = 0 if ($TS eq "*");
+  $NTS = 0 if ($NTS eq "*");
+
+  if ($TS + $NTS != 0) {
+    return sprintf("%4.1f%%", 100*$TS/($TS+$NTS+0.0));
+  } else {
+    return "n/a";
+  }
+}
+
+sub FormatSize {
+  my $Size = shift;
+  if ($Size > 10*1024*1024) {
+    return (int $Size*10 / (1024*1024))/10 . "MB";
+  } elsif ($Size > 10*1024) {
+    return (int $Size / 1024);
+  } else {
+    return $Size . "B";
+  }
+}
+
+sub NoStar {
+  return "0" if ($_[0] eq '*');
+  return $_[0];
+}
+
+sub NoCallNodes {
+  $_[0] =~ m/([0-9]+)\+/;
+  return $1;
+}
+
+# For latex output, limit benchmarks and rename as appropriate
+ at LatexRowMapOrder = (
+            '-' => '-',
+
+            '181.mcf'       => '181.mcf',
+            '256.bzip2'     => '256.bzip2',
+            '164.gzip'      => '164.gzip',
+            '175.vpr'       => '175.vpr',
+            '197.parser'    => '197.parser',
+            '186.crafty'    => '186.crafty',
+            '300.twolf'     => '300.twolf',
+            '255.vortex'    => '255.vortex',
+            '254.gap'       => '254.gap',
+            '252.eon'       => '252.eon',
+            '253.perlbmk'   => '253.perlbmk',
+            '176.gcc'       => '176.gcc',
+            '-' => '-',
+            '179.art'       => '179.art',
+            '183.equake'    => '183.equake',
+            '171.swim'      => '171.swim',
+            '172.mgrid'     => '172.mgrid',
+            '168.wupwise'   => '168.wupwise',
+            '173.applu'     => '173.applu',
+            '188.ammp'      => '188.ammp',
+            '177.mesa'      => '177.mesa',
+            '-' => '-',
+            '129.compress'  => '129.compress',
+            '130.li'        => '130.li',
+            '124.m88ksim'   => '124.m88ksim',
+            '132.ijpeg'     => '132.ijpeg',
+            '099.go'        => '099.go',
+            '134.perl'      => '134.perl',
+            '147.vortex'    => '147.vortex',
+            '126.gcc'       => '126.gcc',
+            '-' => '-',
+            '102.swim'      => '102.swim',
+            '101.tomcatv'   => '101.tomcatv',
+            '107.mgrid'     => '107.mgrid',
+            '145.fpppp'     => '145.fpppp',
+            '104.hydro2d'   => '104.hydro2d',
+            '110.applu'     => '110.applu',
+            '103.su2cor'    => '103.su2cor',
+            '146.wave5'     => '146.wave5',
+            '-' => '-',
+            'fpgrowth' => 'fpgrowth',
+            'bsim'     => 'boxed-sim',
+            'namd'     => 'NAMD',
+            'povray'   => 'povray31',
+           );
+
+ at LxxatexColumns = (1, 2, 19,    # LOC, #MemInstrs, MaxSCC
+                 15,16,       # Total/Collapsed nodes
+                 17, 18);     # Max Size, GG Size
+
+ at LatexColumns = (2, 21, 22, 23);  # Type safety numbers
+
+
+# Specify how to format columns nicely for printing...
+%LatexColumnFormat = (
+#                      11 => \&FormatSize,
+#                      12 => \&FormatSize,
+                      16 => \&NoStar,
+                      15 => \&NoCallNodes,
+                      18 => \&NoCallNodes
+                     );
+
+ at Graphs = (["scatter", "timeVmem.txt", 27, 7],
+           ["scatter", "timeVloc.txt", 1, 7]);
+
+
+# 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.
+
+my $USERSYSTTIME = '([0-9.]+)[ 0-9.]+\([^)]+\)[ 0-9.]+\([^)]+\) +';
+(
+# Name
+            ["Name:" , '\'([^\']+)\' Program'],
+            ["LOC:"  , 'LOC: *([0-9]+)'],
+            ["MemInsts", '([0-9]+).*Number of memory instructions'],
+            [],
+# Misc stuff
+            ["NumNodes", "TOTALNODES: *([0-9]+)"],
+            ["NumFold",  "FOLDEDNODES: *([0-9]+)"],
+            [],
+            ["TypeSafeO", "ACCESSES TYPED_O: *([0-9]+)"],
+            ["NonTypeO",  "ACCESSES UNTYPED_O: *([0-9]+)"],
+            ["TSO %" , sub { return TypeSafeRatio(@_); }],
+            [],
+            ["TypeSafe", "ACCESSES TYPED: *([0-9]+)"],
+            ["NonType",  "ACCESSES UNTYPED: *([0-9]+)"],
+            ["TS %" , sub { return TypeSafeRatio(@_); }],
+            [],
+            ["Type1", "ACCESSES TYPED1: *([0-9]+)"],
+            ["Type2", "ACCESSES TYPED2: *([0-9]+)"],
+            ["Type3", "ACCESSES TYPED3: *([0-9]+)"],
+            ["Type4", "ACCESSES TYPED4: *([0-9]+)"],
+            ["I", "ACCESSES I: *([0-9]+)"],
+            ["E", "ACCESSES E: *([0-9]+)"],
+            ["U", "ACCESSES U: *([0-9]+)"],
+            [],
+# Nodes Folded
+            [],
+            ["VAFUNC", "VARARGS_CALLS: *([0-9]+)"],
+            ["FUNCSPEC", "CLONED_FUNCSPEC: *([0-9]+)"],
+            ["INDCLONE", "CLONED_INDCLONE: *([0-9]+)"],
+            ["StdLibFold", "STD_LIB_FOLD: *([0-9]+)"],
+            ["Calls", "CALLS1: *([0-9]+)"],
+           );

Propchange: poolalloc/trunk/test/TEST.types.report
------------------------------------------------------------------------------
    svn:executable = *





More information about the llvm-commits mailing list