[llvm-commits] [poolalloc] r107313 - in /poolalloc/trunk/test: Makefile TEST.calltargets.Makefile TEST.calltargets.report

John Criswell criswell at uiuc.edu
Wed Jun 30 12:34:16 PDT 2010


Author: criswell
Date: Wed Jun 30 14:34:16 2010
New Revision: 107313

URL: http://llvm.org/viewvc/llvm-project?rev=107313&view=rev
Log:
Added a test to compute the call targets of indirect function calls.

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

Modified: poolalloc/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=107313&r1=107312&r2=107313&view=diff
==============================================================================
--- poolalloc/trunk/test/Makefile (original)
+++ poolalloc/trunk/test/Makefile Wed Jun 30 14:34:16 2010
@@ -41,8 +41,13 @@
 NORMAL_PROBLEM_SIZE_DIRS := \
    MultiSource/Benchmarks/Olden \
    External/SPEC/CINT2000 \
-   #MultiSource/Benchmarks/Olden/bh \
+   #MultiSource/Applications \
+   #MultiSource/Applications/Burg \
+   #MultiSource/Applications/hexxagon \
+   #MultiSource/Applications/kimwitu++ \
+   #MultiSource/Applications/lambda-0.1.3 \
    #External/SPEC/CINT2000/175.vpr \
+   #MultiSource/Benchmarks/Olden/bh \
    #External/SPEC/CINT2000/181.mcf \
    #External/SPEC/CINT2000/186.crafty \
    #External/FPGrowth \
@@ -160,6 +165,30 @@
         done
 	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
 
+# Program tests for DSA Call Targets
+progcall::
+	for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \
+            (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=calltargets \
+                   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=calltargets \
+                   report.html) \
+        done
+	@for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \
+            (cd $$dir; \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -s -j1 TEST=calltargets \
+                   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=calltargets \
+                   report) \
+        done
+	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
+
 # Program tests for Pool Allocation
 progtest::
 	for dir in $(LARGE_PROBLEM_SIZE_DIRS); do \

Added: poolalloc/trunk/test/TEST.calltargets.Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.calltargets.Makefile?rev=107313&view=auto
==============================================================================
--- poolalloc/trunk/test/TEST.calltargets.Makefile (added)
+++ poolalloc/trunk/test/TEST.calltargets.Makefile Wed Jun 30 14:34:16 2010
@@ -0,0 +1,95 @@
+##===- poolalloc/test/TEST.poolalloc.Makefile --------------*- Makefile -*-===##
+#
+# This test runs the pool allocator on all of the Programs, producing some
+# performance numbers and statistics.
+#
+##===----------------------------------------------------------------------===##
+
+CFLAGS = -O2 -fno-strict-aliasing
+
+EXTRA_PA_FLAGS := 
+
+# HEURISTIC can be set to:
+#   AllNodes
+ifdef HEURISTIC
+EXTRA_PA_FLAGS += -poolalloc-heuristic=$(HEURISTIC)
+endif
+
+
+CURDIR  := $(shell cd .; pwd)
+PROGDIR := $(shell cd $(LLVM_SRC_ROOT)/projects/test-suite; pwd)/
+RELDIR  := $(subst $(PROGDIR),,$(CURDIR))
+PADIR   := $(LLVM_OBJ_ROOT)/projects/poolalloc
+
+# Watchdog utility
+WATCHDOG := $(LLVM_OBJ_ROOT)/projects/poolalloc/$(CONFIGURATION)/bin/watchdog
+
+# Bits of runtime to improve analysis
+PA_PRE_RT := $(PADIR)/$(CONFIGURATION)/lib/libpa_pre_rt.bca
+
+# Pool allocator pass shared object
+PA_SO    := $(PADIR)/$(CONFIGURATION)/lib/libpoolalloc$(SHLIBEXT)
+DSA_SO   := $(PADIR)/$(CONFIGURATION)/lib/libLLVMDataStructure$(SHLIBEXT)
+ASSIST_SO := $(PADIR)/$(CONFIGURATION)/lib/libAssistDS$(SHLIBEXT)
+
+# Pool allocator runtime library
+#PA_RT    := $(PADIR)/$(CONFIGURATION)/lib/libpoolalloc_fl_rt.bc
+#PA_RT_O  := $(PROJECT_DIR)/lib/$(CONFIGURATION)/poolalloc_rt.o
+PA_RT_O  := $(PADIR)/$(CONFIGURATION)/lib/libpoolalloc_rt.a
+#PA_RT_O  := $(PROJECT_DIR)/lib/$(CONFIGURATION)/poolalloc_fl_rt.o
+
+# Command to run opt with the pool allocator pass loaded
+OPT_PA := $(WATCHDOG) $(LOPT) -load $(DSA_SO) -load $(PA_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
+
+OPTZN_PASSES := -globaldce -ipsccp -deadargelim -adce -instcombine -simplifycfg
+
+
+$(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) $(ASSIST_SO)
+	-$(LOPT) -load $(ASSIST_SO) -instnamer -internalize -indclone -funcspec -ipsccp -deadargelim -instcombine -globaldce -stats $< -f -o $@ 
+
+# This rule runs the pool allocator on the .base.bc file to produce a new .bc
+# file
+$(PROGRAMS_TO_TEST:%=Output/%.calltargets.data): \
+Output/%.calltargets.data: Output/%.base.bc $(PA_SO) $(LOPT)
+	- at rm -f $(CURDIR)/$@.info
+	-$(OPT_PA_STATS) -analyze -internalize -calltarget $< 2>&1 > $@
+
+# 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/%.calltargets.data       \
+                             Output/%.LOC.txt
+	@-cat $<
+	@echo > $@
+	@echo "---------------------------------------------------------------" >> $@
+	@echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
+	@echo "---------------------------------------------------------------" >> $@
+	@echo >> $@
+	@-if test -f Output/$*.nonpa.diff-nat; then \
+	  printf "GCC-RUN-TIME: " >> $@;\
+	  grep "^program" Output/$*.out-nat.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.calltargets.report
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.calltargets.report?rev=107313&view=auto
==============================================================================
--- poolalloc/trunk/test/TEST.calltargets.report (added)
+++ poolalloc/trunk/test/TEST.calltargets.report Wed Jun 30 14:34:16 2010
@@ -0,0 +1,85 @@
+##=== TEST.poolalloc.report - Report description for poolalloc -*- perl -*-===##
+#
+# This file defines a report to be generated for the pool allocator 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->[4] ne "*" and
+      $Cols->[4] != "0") {
+    return sprintf "%7.2f", 100*$Cols->[$Col-1]/$Cols->[4];
+  } 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],
+ []
+);
+





More information about the llvm-commits mailing list