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

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 15 16:34:01 PDT 2003


Changes in directory poolalloc/test:

TEST.poolalloc.Makefile added (r1.1)
TEST.poolalloc.report added (r1.1)
Makefile updated: 1.1 -> 1.2

---
Log message:

Initial checkin of the pool allocator test and report descriptions


---
Diffs of the changes:

Index: poolalloc/test/TEST.poolalloc.Makefile
diff -c /dev/null poolalloc/test/TEST.poolalloc.Makefile:1.1
*** /dev/null	Fri Aug 15 16:33:13 2003
--- poolalloc/test/TEST.poolalloc.Makefile	Fri Aug 15 16:33:03 2003
***************
*** 0 ****
--- 1,75 ----
+ ##===- poolalloc/test/TEST.poolalloc.Makefile --------------*- Makefile -*-===##
+ #
+ # This test runs the pool allocator on all of the Programs, producing some
+ # performance numbers and statistics.
+ #
+ ##===----------------------------------------------------------------------===##
+ 
+ CURDIR  := $(shell cd .; pwd)
+ PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/
+ RELDIR  := $(subst $(PROGDIR),,$(CURDIR))
+ 
+ # Pool allocator shared object and runtime library...
+ PA_SO  := $(PROJECT_DIR)/lib/Debug/libpoolalloc.so
+ PA_RT  := $(PROJECT_DIR)/lib/Bytecode/libpoolalloc.bc
+ 
+ # 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
+ 
+ # This rule runs the pool allocator on the .llvm.bc file to produce a new .bc
+ # file
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).transformed.bc): \
+ Output/%.$(TEST).transformed.bc: Output/%.llvm.bc $(PA_SO)
+ 	-$(OPT_PA_STATS) -q -poolalloc $< -o $@ -f 2>&1 > $@.out
+ 
+ # This rule compiles the new .bc file into a .s file using LLC
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.llc.s): \
+ Output/%.poolalloc.llc.s: Output/%.llvm.bc $(LLC)
+ 	-$(LLC) $(LLCFLAGS) -f $< -o $@
+ 
+ # This rule compiles the .s file into an executable using $CC
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.llc): \
+ Output/%.poolalloc.llc: Output/%.poolalloc.llc.s
+ 	-$(CC) $(CFLAGS) $< $(LLCLIBS) $(LDFLAGS) -o $@
+ 
+ # This rule runs the generated executable, generating timing information
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.out-llc): \
+ Output/%.poolalloc.out-llc: Output/%.poolalloc.llc
+ 	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
+ 
+ # This rule diffs the post-poolallocated version to make sure we didn't break
+ # the program!
+ $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.diff-llc): \
+ Output/%.poolalloc.diff-llc: Output/%.out-nat Output/%.poolalloc.out-llc
+ 	@cp Output/$*.out-nat Output/$*.poolalloc.out-nat
+ 	-$(DIFFPROG) llc $*.poolalloc $(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/%.$(TEST).transformed.bc Output/%.exe-llc \
+ 			     Output/%.poolalloc.diff-llc
+ 	@echo > $@
+ 	@-if test -f Output/$*.poolalloc.diff-llc; then \
+ 	  printf "LLC-RUN-TIME-NORMAL: " >> $@;\
+ 	  grep "^real" Output/$*.out-llc.time >> $@;\
+ 	  printf "LLC-RUN-TIME-POOLALLOC: " >> $@;\
+ 	  grep "^real" Output/$*.poolalloc.out-llc.time >> $@;\
+ 	fi
+ 
+ 	@#cat Output/$*.$(TEST).transformed.bc.info >> $@
+ 	@#cat Output/$*.$(TEST).transformed.bc.out  >> $@
+ 
+ 
+ $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+ test.$(TEST).%: Output/%.$(TEST).report.txt
+ 	@echo "---------------------------------------------------------------"
+ 	@echo ">>> ========= '$(RELDIR)/$*' Program"
+ 	@echo "---------------------------------------------------------------"
+ 	@cat $<


Index: poolalloc/test/TEST.poolalloc.report
diff -c /dev/null poolalloc/test/TEST.poolalloc.report:1.1
*** /dev/null	Fri Aug 15 16:33:13 2003
--- poolalloc/test/TEST.poolalloc.report	Fri Aug 15 16:33:03 2003
***************
*** 0 ****
--- 1,32 ----
+ ##=== 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;
+ 
+ sub Ratio {
+   my ($Cols, $Col) = @_;
+   if ($Cols->[$Col-1] ne "*" and $Cols->[$Col-2] ne "*" and
+       $Cols->[$Col-1] != "0") {
+     return 100.0*$Cols->[$Col-2]/$Cols->[$Col-1] . "%";
+   } else {
+     return "n/a";
+   }
+ }
+ 
+ # 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
+  ["Normal<br>ExeTime"  , 'LLC-RUN-TIME-NORMAL: real[\t ]+0m([0-9.]+)'],
+  ["PoolAlloc<br>ExeTime", 'LLC-RUN-TIME-POOLALLOC: real[\t ]+0m([0-9.]+)'],
+  ["% Speedup", \&Ratio],         # Normal / PA
+  []
+ );


Index: poolalloc/test/Makefile
diff -u poolalloc/test/Makefile:1.1 poolalloc/test/Makefile:1.2
--- poolalloc/test/Makefile:1.1	Fri Aug 15 14:59:34 2003
+++ poolalloc/test/Makefile	Fri Aug 15 16:33:03 2003
@@ -14,5 +14,6 @@
 # test target - Descend into test/Programs and run the TEST.poolalloc.Makefile
 # tests...
 test::
-	(cd $(LLVM_SRC_ROOT)/test/Programs; PROJECT_DIR=$(BUILD_OBJ_ROOT) \
-                $(MAKE) TEST=poolalloc)
+	(cd $(LLVM_SRC_ROOT)/test/Programs/$(SUBDIR); \
+               PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) TEST=poolalloc \
+                   report report.html )





More information about the llvm-commits mailing list