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

Chris Lattner lattner at cs.uiuc.edu
Fri Jun 20 18:07:02 PDT 2003


Changes in directory llvm/test/Programs:

TEST.micro.Makefile added (r1.1)
TEST.micro.report added (r1.1)

---
Log message:

add scripts used to generate numbers for the MICRO paper


---
Diffs of the changes:

Index: llvm/test/Programs/TEST.micro.Makefile
diff -c /dev/null llvm/test/Programs/TEST.micro.Makefile:1.1
*** /dev/null	Fri Jun 20 18:06:12 2003
--- llvm/test/Programs/TEST.micro.Makefile	Fri Jun 20 18:06:02 2003
***************
*** 0 ****
--- 1,40 ----
+ ##===- test/Programs/TEST.jit.Makefile ---------------------*- Makefile -*-===##
+ #
+ # This test tries running the Just-In-Time compiler on all of the programs to
+ # see which ones work and which ones don't.  It provides a report to tabulate
+ # this nicely and provides some simple statistics.
+ #
+ ##===----------------------------------------------------------------------===##
+ 
+ #JIT_OPTS = -force-interpreter=false -stats -time-passes
+ CURDIR  := $(shell cd .; pwd)
+ PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/
+ RELDIR  := $(subst $(PROGDIR),,$(CURDIR))
+ 
+ TIMEOPT = -time-passes -stats -info-output-file=$(CURDIR)/$@.info
+ EXTRA_LLI_OPTS = $(TIMEOPT)
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
+ Output/%.$(TEST).report.txt: Output/%.llvm.bc Output/%.LOC.txt Output/%.out-nat Output/%.out-jit $(LLI) $(LOPT)
+ 	@echo -n "LOC: " > $@
+ 	@cat Output/$*.LOC.txt >> $@
+ 	@echo -n "LLC SIZE: " >> $@
+ 	#- at wc -c Output/$*.llc >> $@
+ 	@echo >> $@
+ 	@echo -n "NAT TIME: " >> $@
+ 	- at grep real Output/$*.out-nat.time >> $@
+ 	@echo -n "JIT TIME: " >> $@
+ 	- at grep real Output/$*.out-jit.time >> $@
+ 	@cat Output/$*.out-jit.info >> $@
+ 	$(LOPT) -strip -stats -o /dev/null -f $< >> $@ 2>&1
+ 
+ $(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 lli changes
+ #
+ REPORT_DEPENDENCIES := $(LLI) $(LOPT)


Index: llvm/test/Programs/TEST.micro.report
diff -c /dev/null llvm/test/Programs/TEST.micro.report:1.1
*** /dev/null	Fri Jun 20 18:06:12 2003
--- llvm/test/Programs/TEST.micro.report	Fri Jun 20 18:06:02 2003
***************
*** 0 ****
--- 1,146 ----
+ ##=== TEST.jit.report - Report description for jit tests -------*- perl -*-===##
+ #
+ # This file defines a report to be generated for the jit test.
+ #
+ # This report should be generated with the following command:
+ #    gmake ENABLE_OPTIMIZED=1 TEST=micro RUNTIMELIMIT=120 LARGE_PROBLEM_SIZE=1 CFLAGS=-O3
+ #
+ ##===----------------------------------------------------------------------===##
+ 
+ # Sort by name
+ $SortCol = 4;
+ 
+ ## Sort in descending order
+ $SortReverse = 1;
+ $SortNumeric = 1;
+ 
+ # Helper function
+ sub Ratio {
+   my ($Cols, $Col) = @_;
+   if ($Cols->[$Col-1] ne "*" and
+       $Cols->[$Col-1] != "0") {
+     return 0 if ($Cols->[$Col-2] eq "*");
+     return $Cols->[$Col-2]/$Cols->[$Col-1];
+   } else {
+     return "n/a";
+   }
+ }
+ sub InvRatio {
+   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 LLVMRatio {
+   my ($Cols, $Col) = @_;
+   if ($Cols->[5] ne "*") {
+     return $Cols->[5]*1733333333/$Cols->[10];
+   } else {
+     return "n/a";
+   }
+ }
+ 
+ sub FormatSize {
+   my $Size = shift;
+   return "*" if ($Size eq "*");
+   if ($Size > 10*1024*1024) {
+     return (int $Size*10 / (1024*1024))/10 . "MB";
+   } elsif ($Size > 10*1024) {
+     return sprintf("%2.1f", $Size / 1024) . "KB";
+   } else {
+     return $Size . "B";
+   }
+ }
+ 
+ sub FormatSizeKB {
+   my $Size = shift;
+   return "*" if ($Size eq "*");
+   return sprintf("%2.1f", $Size / 1024);
+ }
+ 
+ sub FormatRatio {
+   return sprintf("%0.2f", shift);
+ }
+ sub FormatRatio2 {
+   return sprintf("%0.3f", shift);
+ }
+ 
+ @LatexColumns = (1, 15, 12,    # LOC, LLC Size, BytecodeSize
+                  10, 9, 11,     # #LLVM Insts, # MachineInsts, Ratio
+                  5, 4, 6);     # JIT Time, Nat Run Time, Ratio
+ 
+ # Specify how to format columns nicely for printing...
+ %LatexColumnFormat = (
+                        6 => \&FormatRatio2,
+                       11 => \&FormatRatio,
+                       12 => \&FormatSizeKB,
+                       15 => \&FormatSizeKB,
+                      );
+ 
+ # For latex output, limit benchmarks and rename as appropriate
+ @LatexRowMapOrder = (
+             'treeadd'    => 'Olden-treeadd',
+             'bisort'     => 'Olden-bisort',
+             'mst'        => 'Olden-mst',
+             'perimeter'  => 'Olden-perimeter',
+             'health'     => 'Olden-health',
+             'tsp'        => 'Olden-tsp',
+             'power'      => 'Olden-power',
+             'em3d'       => 'Olden-em3d',
+             'voronoi'    => 'Olden-voronoi',
+             'bh'         => 'Olden-bh',
+             '-' => '-',
+             'anagram'    => 'ptrdist-anagram',
+             'ks'         => 'ptrdist-ks',
+             'ft'         => 'ptrdist-ft',
+             'yacr2'      => 'ptrdist-yacr2',
+             'bc'         => 'ptrdist-bc',
+             '-' => '-',
+             '181.mcf'    => '181.mcf',
+             '256.bzip2'  => '256.bzip2',
+             '164.gzip'   => '164.gzip',
+             '197.parser' => '197.parser',
+             '175.vpr'    => '175.vpr',
+             '186.crafty' => '186.crafty',
+             '255.vortex'    => '255.vortex',
+ #            '-' => '-',
+ #            'sgefa'      => 'sgefa',
+ #            'sim'        => 'sim',
+ #            'burg'       => 'burg',
+ #            'fhourstones' => 'fhourstones',
+ #            'optimizer-eval' => 'optimizer-eval',
+ #            'flops' => 'flops',
+ #            'llu' => 'llubenchmark'
+            );
+ 
+ 
+ # 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: *([0-9]+)'],
+  [],
+ # Times
+  ["Total"  , 'JIT TIME: real ([0-9.]+)'],
+  ["NatTotal", 'NAT TIME: real ([0-9.]+)'],
+  ["CodeGen", 'Total Execution Time: ([0-9.]+)'],
+  ["CodeGenRatio", \&InvRatio],
+  [],
+ # Sizes
+  ["MCSize"   , '([0-9]+).*Number of bytes of machine code compiled'],
+  ["#MCInsts" , '([0-9]+).*Number of machine instructions emitted'],
+  ["LLVMInsts", '([0-9]+).*Number of instructions'],
+  ["mc/LLVM ratio", \&Ratio],
+  ["BytcdSize", '([0-9]+).*Number of bytecode bytes written'],
+  [],
+  ["Cycle/LLVM", \&LLVMRatio],
+  ["LLC Size", 'LLC SIZE: *([0-9]+)'],
+ # Number of transformations
+  []
+ );





More information about the llvm-commits mailing list