Author: lattner Date: Mon Dec 3 17:57:31 2007 New Revision: 44562 URL: http://llvm.org/viewvc/llvm-project?rev=44562&view=rev Log: Add a new beta-compare report, for comparing static measurements of llc output. At this point, it compares code size. For example, running this on ppc on olden currently prints:
$ make TEST=beta-compare report Name: | #Insts Beta LLC/BETA | bh/bh | 1968 1875 1.050 | em3d/em3d | 651 631 1.032 | mst/mst | 444 416 1.067 | power/power | 1012 994 1.018 | tsp/tsp | 860 777 1.107 | bisort/bisort | 764 712 1.073 | health/health | 855 806 1.061 | perimeter/perimeter | 1308 1129 1.159 | treeadd/treeadd | 247 233 1.060 | voronoi/voronoi | 2539 2420 1.049 | Looks like llc-beta is good right now :) Added: test-suite/trunk/TEST.beta-compare.Makefile test-suite/trunk/TEST.beta-compare.report Added: test-suite/trunk/TEST.beta-compare.Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.beta-compare.Makefile?rev=44562&view=auto ============================================================================== --- test-suite/trunk/TEST.beta-compare.Makefile (added) +++ test-suite/trunk/TEST.beta-compare.Makefile Mon Dec 3 17:57:31 2007 @@ -0,0 +1,38 @@ +##===- TEST.beta-compare.Makefile -----------------------------------*- Makefile -*-===## +# +# This test runs llc and llc-beta and generates numbers to compare their static +# values produced by -stats. +# +##===----------------------------------------------------------------------===## + +LLC_OPTS = $(LLCFLAGS) -f -o=/dev/null -stats -time-passes +CURDIR := $(shell cd .; pwd) +PROGDIR := $(PROJ_SRC_ROOT) +RELDIR := $(subst $(PROGDIR),,$(CURDIR)) + +$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).llc-info.txt): \ +Output/%.$(TEST).llc-info.txt: Output/%.llvm.bc $(LLC) + - $(LLC) $(LLC_OPTS) $< -info-output-file=$@ + +$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).llc-beta-info.txt): \ +Output/%.$(TEST).llc-beta-info.txt: Output/%.llvm.bc $(LLC) + - $(LLC) $(LLC_OPTS) $(LLCBETAOPTION) $< -info-output-file=$@ + + +$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ +Output/%.$(TEST).report.txt: Output/%.$(TEST).llc-info.txt Output/%.$(TEST).llc-beta-info.txt + [EMAIL PROTECTED] "LLC: " > $@ + -grep 'Number of machine instrs printed' Output/$*.$(TEST).llc-info.txt >> $@ + [EMAIL PROTECTED] "LLCBETA: " >> $@ + -grep 'Number of machine instrs printed' Output/$*.$(TEST).llc-beta-info.txt >> $@ + +$(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 llc changes +# +REPORT_DEPENDENCIES := $(LLC) Added: test-suite/trunk/TEST.beta-compare.report URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.beta-compare.report?rev=44562&view=auto ============================================================================== --- test-suite/trunk/TEST.beta-compare.report (added) +++ test-suite/trunk/TEST.beta-compare.report Mon Dec 3 17:57:31 2007 @@ -0,0 +1,32 @@ +##=== TEST.beta-compare.report - Compare llc vs llcbeta -*- perl -*-===## +# +# This file defines a report to be generated for the beta-compare test. +# +##===----------------------------------------------------------------------===## + +# Sort by name +$SortCol = 1; +$TrimRepeatedPrefix = 1; + +sub SizeRatio { + my ($Cols, $Col) = @_; + my $LLC = $Cols->[$Col-2]; + my $BETA = $Cols->[$Col-1]; + return "n/a" if ($LLC eq "*" or $BETA eq "*"); + return sprintf("%2.3f", $LLC/$BETA); +} + + +# 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'], + [], +# Code Size + ["#Insts", 'LLC: ([0-9]+).*Number of machine instrs printed'], + ["Beta", 'LLCBETA: ([0-9]+).*Number of machine instrs printed'], + ["LLC/BETA" , \&SizeRatio], + [] + ); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits