[llvm-commits] CVS: llvm-poolalloc/test/TEST.ptrcomp.Makefile TEST.ptrcomp.report Makefile

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 3 19:35:27 PST 2005



Changes in directory llvm-poolalloc/test:

TEST.ptrcomp.Makefile added (r1.1)
TEST.ptrcomp.report added (r1.1)
Makefile updated: 1.28 -> 1.29
---
Log message:

Add a new pointer compression test and report


---
Diffs of the changes:  (+229 -0)

 Makefile              |    6 ++
 TEST.ptrcomp.Makefile |  144 ++++++++++++++++++++++++++++++++++++++++++++++++++
 TEST.ptrcomp.report   |   79 +++++++++++++++++++++++++++
 3 files changed, 229 insertions(+)


Index: llvm-poolalloc/test/TEST.ptrcomp.Makefile
diff -c /dev/null llvm-poolalloc/test/TEST.ptrcomp.Makefile:1.1
*** /dev/null	Thu Mar  3 21:35:22 2005
--- llvm-poolalloc/test/TEST.ptrcomp.Makefile	Thu Mar  3 21:35:11 2005
***************
*** 0 ****
--- 1,144 ----
+ ##===- poolalloc/test/TEST.ptrcomp.Makefile ----------------*- Makefile -*-===##
+ #
+ # This test runs the pool allocator and pointer compressor on all of the
+ # programs, producing some performance numbers and statistics.
+ #
+ ##===----------------------------------------------------------------------===##
+ 
+ CFLAGS = -O2 -fno-strict-aliasing
+ 
+ EXTRA_PA_FLAGS := 
+ 
+ CURDIR  := $(shell cd .; pwd)
+ PROGDIR := $(shell cd $(LLVM_SRC_ROOT)/projects/llvm-test; pwd)/
+ RELDIR  := $(subst $(PROGDIR),,$(CURDIR))
+ 
+ # Pool allocator pass shared object
+ PA_SO    := $(PROJECT_DIR)/Debug/lib/libpoolalloc$(SHLIBEXT)
+ 
+ # Pool allocator runtime library
+ #PA_RT    := $(PROJECT_DIR)/lib/Bytecode/libpoolalloc_fl_rt.bc
+ #PA_RT_O  := $(PROJECT_DIR)/lib/$(CONFIGURATION)/poolalloc_rt.o
+ PA_RT_O  := $(PROJECT_DIR)/Release/lib/poolalloc_rt.o
+ #PA_RT_O  := $(PROJECT_DIR)/lib/Release/poolalloc_fl_rt.o
+ 
+ # Command to run opt with the pool allocator pass loaded
+ OPT_PA := $(LOPT) -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
+ 
+ 
+ # This rule runs the pool allocator on the .llvm.bc file to produce a new .bc
+ # file
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).poolalloc.bc): \
+ Output/%.$(TEST).poolalloc.bc: Output/%.llvm.bc $(PA_SO) $(LOPT)
+ 	- at rm -f $(CURDIR)/$@.info
+ 	-$(OPT_PA_STATS) -poolalloc $(EXTRA_PA_FLAGS) $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).ptrcomp64.bc): \
+ Output/%.$(TEST).ptrcomp64.bc: Output/%.llvm.bc $(PA_SO) $(LOPT)
+ 	- at rm -f $(CURDIR)/$@.info
+ 	-$(OPT_PA_STATS) -pointercompress $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out
+ 
+ # This rule compiles the new .bc file into a .c file using CBE
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.cbe.c): \
+ Output/%.poolalloc.cbe.c: Output/%.$(TEST).poolalloc.bc $(LLC)
+ 	-$(LLC) -march=c -f $< -o $@
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.ptrcomp64.cbe.c): \
+ Output/%.ptrcomp64.cbe.c: Output/%.$(TEST).ptrcomp64.bc $(LLC)
+ 	-$(LLC) -march=c -f $< -o $@
+ 
+ 
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.cbe): \
+ Output/%.poolalloc.cbe: Output/%.poolalloc.cbe.c $(PA_RT_O)
+ 	-$(CC) $(CFLAGS) $< $(PA_RT_O) $(LLCLIBS) $(LDFLAGS) -o $@
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.ptrcomp64.cbe): \
+ Output/%.ptrcomp64.cbe: Output/%.ptrcomp64.cbe.c $(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/%.poolalloc.out-cbe): \
+ Output/%.poolalloc.out-cbe: Output/%.poolalloc.cbe
+ 	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.ptrcomp64.out-cbe): \
+ Output/%.ptrcomp64.out-cbe: Output/%.ptrcomp64.cbe
+ 	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+ 
+ else
+ 
+ # This rule runs the generated executable, generating timing information, for
+ # SPEC
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.out-cbe): \
+ Output/%.poolalloc.out-cbe: Output/%.poolalloc.cbe
+ 	-$(SPEC_SANDBOX) poolalloccbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+                   ../../$< $(RUN_OPTIONS)
+ 	-(cd Output/poolalloccbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ 	-cp Output/poolalloccbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.ptrcomp64.out-cbe): \
+ Output/%.ptrcomp64.out-cbe: Output/%.ptrcomp64.cbe
+ 	-$(SPEC_SANDBOX) ptrcomp64cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+                   ../../$< $(RUN_OPTIONS)
+ 	-(cd Output/ptrcomp64cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ 	-cp Output/ptrcomp64cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ 
+ endif
+ 
+ 
+ # This rule diffs the post-poolallocated version to make sure we didn't break
+ # the program!
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.diff-cbe): \
+ Output/%.poolalloc.diff-cbe: Output/%.out-nat Output/%.poolalloc.out-cbe
+ 	@cp Output/$*.out-nat Output/$*.poolalloc.out-nat
+ 	-$(DIFFPROG) cbe $*.poolalloc $(HIDEDIFF)
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.ptrcomp64.diff-cbe): \
+ Output/%.ptrcomp64.diff-cbe: Output/%.out-nat Output/%.ptrcomp64.out-cbe
+ 	@cp Output/$*.out-nat Output/$*.ptrcomp64.out-nat
+ 	-$(DIFFPROG) cbe $*.ptrcomp64 $(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/%.poolalloc.diff-cbe     \
+ 			     Output/%.ptrcomp64.diff-cbe      \
+                              Output/%.LOC.txt
+ 	@echo > $@
+ 	@-if test -f Output/$*.ptrcomp64.diff-cbe; then \
+ 	  printf "CBE-RUN-TIME-PTRCOMP64: " >> $@;\
+ 	  grep "^program" Output/$*.ptrcomp64.out-cbe.time >> $@;\
+         fi
+ 	@-if test -f Output/$*.poolalloc.diff-cbe; then \
+ 	  printf "CBE-RUN-TIME-POOLALLOC: " >> $@;\
+ 	  grep "^program" Output/$*.poolalloc.out-cbe.time >> $@;\
+ 	fi
+ 	printf "LOC: " >> $@
+ 	cat Output/$*.LOC.txt >> $@
+ 	@cat Output/$*.$(TEST).ptrcomp64.bc.info >> $@
+ 	@#cat Output/$*.$(TEST).ptrcomp64.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)


Index: llvm-poolalloc/test/TEST.ptrcomp.report
diff -c /dev/null llvm-poolalloc/test/TEST.ptrcomp.report:1.1
*** /dev/null	Thu Mar  3 21:35:27 2005
--- llvm-poolalloc/test/TEST.ptrcomp.report	Thu Mar  3 21:35:12 2005
***************
*** 0 ****
--- 1,79 ----
+ ##=== TEST.ptrcomp.report - Report description for ptrcomp -----*- perl -*-===##
+ #
+ # This file defines a report to be generated for the pointer compression 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";
+   }
+ }
+ 
+ @LatexColumns = (1, 5, 8, 12, 9, 13, 14, 15, 2, 16);
+ 
+ my $FREEBENCH = 'MultiSource/Benchmarks/FreeBench';
+ my $PTRDIST   = 'MultiSource/Benchmarks/Ptrdist';
+ 
+ @LatexRowMapOrder = (
+                      "anagram/anagram"       => 'anagram',
+                      "bc/bc"                 => 'bc',
+                      "ft/ft"                 => 'ft',
+                      "ks/ks"                 => 'ks',
+                      "yacr2/yacr2"           => 'yacr2',
+                      '-' => '-',
+                      '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',
+                      '-' => '-',
+                      "analyzer"     => 'analyzer',
+                      "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
+  ["PA Time",        'CBE-RUN-TIME-POOLALLOC: program\s*([.0-9m:]+)', \&FormatTime],
+  ["PC Time",        'CBE-RUN-TIME-PTRCOMP64: program\s*([.0-9m:]+)', \&FormatTime],
+  ["AN run%",        \&RuntimePercent],
+  [],
+  ["NumPools",       '([0-9]+).*Number of pools allocated'],
+  ["Typesafe",       '([0-9]+).*Number of typesafe pools'],
+  ["BumpPtr",        '([0-9]+).*Number of bump pointer pools'],
+  ["NumArgs",        '([0-9]+).*Number of function arguments added'],
+ #["Nonprofit",      '([0-9]+).*Number of DSNodes not profitable'],
+  []
+ );
+ 


Index: llvm-poolalloc/test/Makefile
diff -u llvm-poolalloc/test/Makefile:1.28 llvm-poolalloc/test/Makefile:1.29
--- llvm-poolalloc/test/Makefile:1.28	Fri Feb  4 14:21:27 2005
+++ llvm-poolalloc/test/Makefile	Thu Mar  3 21:35:11 2005
@@ -146,6 +146,12 @@
                    GET_STABLE_NUMBERS=1 report report.html)
 	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
 
+ptrcomp::
+	(cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+               PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=ptrcomp \
+                   GET_STABLE_NUMBERS=1 report report.html)
+	@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
+
 vtl::
 	(cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
                PROJECT_DIR=$(PROJ_OBJ_ROOT) $(MAKE) -j1 TEST=pavtl \






More information about the llvm-commits mailing list