[llvm-commits] CVS: poolalloc/test/TEST.optzn.Makefile TEST.optzn.report Makefile TEST.poolalloc.Makefile TEST.poolalloc.report
Chris Lattner
lattner at cs.uiuc.edu
Thu Nov 11 02:13:11 PST 2004
Changes in directory poolalloc/test:
TEST.optzn.Makefile added (r1.1)
TEST.optzn.report added (r1.1)
Makefile updated: 1.26 -> 1.27
TEST.poolalloc.Makefile updated: 1.33 -> 1.34
TEST.poolalloc.report updated: 1.24 -> 1.25
---
Log message:
Add an optimization report, tweak other reports
---
Diffs of the changes: (+315 -7)
Index: poolalloc/test/TEST.optzn.Makefile
diff -c /dev/null poolalloc/test/TEST.optzn.Makefile:1.1
*** /dev/null Thu Nov 11 04:13:11 2004
--- poolalloc/test/TEST.optzn.Makefile Thu Nov 11 04:13:00 2004
***************
*** 0 ****
--- 1,222 ----
+ ##===- poolalloc/test/TEST.optzn.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/llvm-test; pwd)/
+ RELDIR := $(subst $(PROGDIR),,$(CURDIR))
+
+ # Pool allocator pass shared object
+ PA_SO := $(PROJECT_DIR)/lib/Debug/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)/lib/Release/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 -ipconstprop -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).selectivepa.bc): \
+ Output/%.$(TEST).selectivepa.bc: Output/%.llvm.bc $(PA_SO) $(LOPT)
+ - at rm -f $(CURDIR)/$@.info
+ -$(OPT_PA_STATS) -poolalloc -poolalloc-heuristic=AllNodes $(EXTRA_PA_FLAGS) $(OPTZN_PASSES) -pooloptimize $< -o $@ -f 2>&1 > $@.out
+
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).bumpptr.bc): \
+ Output/%.$(TEST).bumpptr.bc: Output/%.llvm.bc $(PA_SO) $(LOPT)
+ - at rm -f $(CURDIR)/$@.info
+ -$(OPT_PA_STATS) -poolalloc $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out
+
+
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).basepa.bc): \
+ Output/%.$(TEST).basepa.bc: Output/%.llvm.bc $(PA_SO) $(LOPT)
+ - at rm -f $(CURDIR)/$@.info
+ -$(OPT_PA_STATS) -poolalloc -poolalloc-heuristic=AllNodes -poolalloc-force-all-poolfrees $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out
+
+
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).freeelim.bc): \
+ Output/%.$(TEST).freeelim.bc: Output/%.llvm.bc $(PA_SO) $(LOPT)
+ - at rm -f $(CURDIR)/$@.info
+ -$(OPT_PA_STATS) -poolalloc -poolalloc-force-all-poolfrees $(OPTZN_PASSES) -pooloptimize $< -o $@ -f 2>&1 > $@.out
+
+
+ # This rule compiles the new .bc file into a .c file using CBE
+ $(PROGRAMS_TO_TEST:%=Output/%.selectivepa.cbe.c): \
+ Output/%.selectivepa.cbe.c: Output/%.$(TEST).selectivepa.bc $(LLC)
+ -$(LLC) -march=c -f $< -o $@
+
+ $(PROGRAMS_TO_TEST:%=Output/%.bumpptr.cbe.c): \
+ Output/%.bumpptr.cbe.c: Output/%.$(TEST).bumpptr.bc $(LLC)
+ -$(LLC) -march=c -f $< -o $@
+
+ $(PROGRAMS_TO_TEST:%=Output/%.basepa.cbe.c): \
+ Output/%.basepa.cbe.c: Output/%.$(TEST).basepa.bc $(LLC)
+ -$(LLC) -march=c -f $< -o $@
+
+ $(PROGRAMS_TO_TEST:%=Output/%.freeelim.cbe.c): \
+ Output/%.freeelim.cbe.c: Output/%.$(TEST).freeelim.bc $(LLC)
+ -$(LLC) -march=c -f $< -o $@
+
+
+
+ $(PROGRAMS_TO_TEST:%=Output/%.selectivepa.cbe): \
+ Output/%.selectivepa.cbe: Output/%.selectivepa.cbe.c $(PA_RT_O)
+ -$(CC) $(CFLAGS) $< $(PA_RT_O) $(LLCLIBS) $(LDFLAGS) -o $@
+
+ $(PROGRAMS_TO_TEST:%=Output/%.bumpptr.cbe): \
+ Output/%.bumpptr.cbe: Output/%.bumpptr.cbe.c $(PA_RT_O)
+ -$(CC) $(CFLAGS) $< $(PA_RT_O) $(LLCLIBS) $(LDFLAGS) -o $@
+
+ $(PROGRAMS_TO_TEST:%=Output/%.basepa.cbe): \
+ Output/%.basepa.cbe: Output/%.basepa.cbe.c $(PA_RT_O)
+ -$(CC) $(CFLAGS) $< $(PA_RT_O) $(LLCLIBS) $(LDFLAGS) -o $@
+
+ $(PROGRAMS_TO_TEST:%=Output/%.freeelim.cbe): \
+ Output/%.freeelim.cbe: Output/%.freeelim.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/%.selectivepa.out-cbe): \
+ Output/%.selectivepa.out-cbe: Output/%.selectivepa.cbe
+ -$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+
+ $(PROGRAMS_TO_TEST:%=Output/%.bumpptr.out-cbe): \
+ Output/%.bumpptr.out-cbe: Output/%.bumpptr.cbe
+ -$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+
+ $(PROGRAMS_TO_TEST:%=Output/%.basepa.out-cbe): \
+ Output/%.basepa.out-cbe: Output/%.basepa.cbe
+ -$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+
+ $(PROGRAMS_TO_TEST:%=Output/%.freeelim.out-cbe): \
+ Output/%.freeelim.out-cbe: Output/%.freeelim.cbe
+ -$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+
+ else
+
+ # This rule runs the generated executable, generating timing information, for
+ # SPEC
+ $(PROGRAMS_TO_TEST:%=Output/%.selectivepa.out-cbe): \
+ Output/%.selectivepa.out-cbe: Output/%.selectivepa.cbe
+ -$(SPEC_SANDBOX) selectivepacbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ ../../$< $(RUN_OPTIONS)
+ -(cd Output/selectivepacbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ -cp Output/selectivepacbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+
+ $(PROGRAMS_TO_TEST:%=Output/%.bumpptr.out-cbe): \
+ Output/%.bumpptr.out-cbe: Output/%.bumpptr.cbe
+ -$(SPEC_SANDBOX) bumpptrcbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ ../../$< $(RUN_OPTIONS)
+ -(cd Output/bumpptrcbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ -cp Output/bumpptrcbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+
+ $(PROGRAMS_TO_TEST:%=Output/%.basepa.out-cbe): \
+ Output/%.basepa.out-cbe: Output/%.basepa.cbe
+ -$(SPEC_SANDBOX) basepacbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ ../../$< $(RUN_OPTIONS)
+ -(cd Output/basepacbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ -cp Output/basepacbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+
+ $(PROGRAMS_TO_TEST:%=Output/%.freeelim.out-cbe): \
+ Output/%.freeelim.out-cbe: Output/%.freeelim.cbe
+ -$(SPEC_SANDBOX) freeelimcbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
+ ../../$< $(RUN_OPTIONS)
+ -(cd Output/freeelimcbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ -cp Output/freeelimcbe-$(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/%.selectivepa.diff-cbe): \
+ Output/%.selectivepa.diff-cbe: Output/%.out-nat Output/%.selectivepa.out-cbe
+ @cp Output/$*.out-nat Output/$*.selectivepa.out-nat
+ -$(DIFFPROG) cbe $*.selectivepa $(HIDEDIFF)
+
+ $(PROGRAMS_TO_TEST:%=Output/%.bumpptr.diff-cbe): \
+ Output/%.bumpptr.diff-cbe: Output/%.out-nat Output/%.bumpptr.out-cbe
+ @cp Output/$*.out-nat Output/$*.bumpptr.out-nat
+ -$(DIFFPROG) cbe $*.bumpptr $(HIDEDIFF)
+
+ $(PROGRAMS_TO_TEST:%=Output/%.basepa.diff-cbe): \
+ Output/%.basepa.diff-cbe: Output/%.out-nat Output/%.basepa.out-cbe
+ @cp Output/$*.out-nat Output/$*.basepa.out-nat
+ -$(DIFFPROG) cbe $*.basepa $(HIDEDIFF)
+
+ $(PROGRAMS_TO_TEST:%=Output/%.freeelim.diff-cbe): \
+ Output/%.freeelim.diff-cbe: Output/%.out-nat Output/%.freeelim.out-cbe
+ @cp Output/$*.out-nat Output/$*.freeelim.out-nat
+ -$(DIFFPROG) cbe $*.freeelim $(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/%.selectivepa.diff-cbe \
+ Output/%.bumpptr.diff-cbe \
+ Output/%.basepa.diff-cbe \
+ Output/%.freeelim.diff-cbe \
+ Output/%.LOC.txt
+ @echo > $@
+ @-if test -f Output/$*.basepa.diff-cbe; then \
+ printf "CBE-RUN-TIME-BASEPA: " >> $@;\
+ grep "^program" Output/$*.basepa.out-cbe.time >> $@;\
+ fi
+ @-if test -f Output/$*.freeelim.diff-cbe; then \
+ printf "CBE-RUN-TIME-FREEELIM: " >> $@;\
+ grep "^program" Output/$*.freeelim.out-cbe.time >> $@;\
+ fi
+ @-if test -f Output/$*.bumpptr.diff-cbe; then \
+ printf "CBE-RUN-TIME-BUMPPTR: " >> $@;\
+ grep "^program" Output/$*.bumpptr.out-cbe.time >> $@;\
+ fi
+ @-if test -f Output/$*.selectivepa.diff-cbe; then \
+ printf "CBE-RUN-TIME-SELECTIVEPA: " >> $@;\
+ grep "^program" Output/$*.selectivepa.out-cbe.time >> $@;\
+ fi
+
+
+ $(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: poolalloc/test/TEST.optzn.report
diff -c /dev/null poolalloc/test/TEST.optzn.report:1.1
*** /dev/null Thu Nov 11 04:13:11 2004
--- poolalloc/test/TEST.optzn.report Thu Nov 11 04:13:00 2004
***************
*** 0 ****
--- 1,74 ----
+ ##=== TEST.optzn.report - Report description for optzn ---------*- 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";
+ }
+ }
+
+ @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'],
+ [],
+ # Times
+ ["BasePA", 'CBE-RUN-TIME-BASEPA: program\s*([.0-9m:]+)', \&FormatTime],
+ [],
+ ["NoSelectivePA", 'CBE-RUN-TIME-SELECTIVEPA: program\s*([.0-9m:]+)', \&FormatTime],
+ ["NoFreeElim", 'CBE-RUN-TIME-FREEELIM: program\s*([.0-9m:]+)', \&FormatTime],
+ ["NoBumpPtr", 'CBE-RUN-TIME-BUMPPTR: program\s*([.0-9m:]+)', \&FormatTime],
+ []
+ );
+
Index: poolalloc/test/Makefile
diff -u poolalloc/test/Makefile:1.26 poolalloc/test/Makefile:1.27
--- poolalloc/test/Makefile:1.26 Tue Nov 9 13:42:15 2004
+++ poolalloc/test/Makefile Thu Nov 11 04:13:00 2004
@@ -158,6 +158,12 @@
test report report.csv)
@printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
+optzn::
+ (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
+ PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) -j1 TEST=optzn \
+ GET_STABLE_NUMBERS=1 test report report.csv)
+ @printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a"
+
p4perf::
(cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \
PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) -j1 TEST=p4perf \
Index: poolalloc/test/TEST.poolalloc.Makefile
diff -u poolalloc/test/TEST.poolalloc.Makefile:1.33 poolalloc/test/TEST.poolalloc.Makefile:1.34
--- poolalloc/test/TEST.poolalloc.Makefile:1.33 Wed Nov 10 17:39:08 2004
+++ poolalloc/test/TEST.poolalloc.Makefile Thu Nov 11 04:13:00 2004
@@ -49,7 +49,7 @@
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).allnodes.bc): \
Output/%.$(TEST).allnodes.bc: Output/%.llvm.bc $(PA_SO) $(LOPT)
- at rm -f $(CURDIR)/$@.info
- -$(OPT_PA_STATS) -poolalloc -poolalloc-heuristic=AllNodes -pooloptimize $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out
+ -$(OPT_PA_STATS) -poolalloc -poolalloc-heuristic=AllNodes $(OPTZN_PASSES) -pooloptimize $< -o $@ -f 2>&1 > $@.out
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).mallocrepl.bc): \
@@ -213,7 +213,8 @@
# 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/%.nonpa.diff-cbe \
+Output/%.$(TEST).report.txt: Output/%.out-nat \
+ Output/%.nonpa.diff-cbe \
Output/%.poolalloc.diff-cbe \
Output/%.allnodes.diff-cbe \
Output/%.mallocrepl.diff-cbe \
@@ -221,6 +222,10 @@
Output/%.LOC.txt
@echo > $@
@-if test -f Output/$*.nonpa.diff-cbe; then \
+ printf "GCC-RUN-TIME: " >> $@;\
+ grep "^program" Output/$*.out-nat.time >> $@;\
+ fi
+ @-if test -f Output/$*.nonpa.diff-cbe; then \
printf "CBE-RUN-TIME-NORMAL: " >> $@;\
grep "^program" Output/$*.nonpa.out-cbe.time >> $@;\
fi
Index: poolalloc/test/TEST.poolalloc.report
diff -u poolalloc/test/TEST.poolalloc.report:1.24 poolalloc/test/TEST.poolalloc.report:1.25
--- poolalloc/test/TEST.poolalloc.report:1.24 Wed Nov 10 17:39:08 2004
+++ poolalloc/test/TEST.poolalloc.report Thu Nov 11 04:13:00 2004
@@ -15,15 +15,15 @@
return sprintf("%7.3f", $1*60.0+$2);
}
- return sprintf("%7.2f", $Time);
+ 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];
+ 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";
}
@@ -65,7 +65,8 @@
["LOC" , 'LOC:\s*([0-9]+)'],
[],
# Times
- ["NormalTime", 'CBE-RUN-TIME-NORMAL: program\s*([.0-9m:]+)', \&FormatTime],
+ ["GCC", 'GCC-RUN-TIME: program\s*([.0-9m:]+)', \&FormatTime],
+ ["NonPATime", 'CBE-RUN-TIME-NORMAL: program\s*([.0-9m:]+)', \&FormatTime],
[],
["OnlyOHTime", 'CBE-RUN-TIME-ONLYOVERHEAD: program\s*([.0-9m:]+)', \&FormatTime],
["OO run%", \&RuntimePercent],
More information about the llvm-commits
mailing list