Skip to content

Commit

Permalink
Add llc report. Similar to the jit report but it runs faster since it…
Browse files Browse the repository at this point in the history
… doesn't run the actual program

llvm-svn: 10836
  • Loading branch information
alkis committed Jan 14, 2004
1 parent 8b8fc4f commit af2730f
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
27 changes: 27 additions & 0 deletions TEST.llc.Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
##===- test/Programs/TEST.llc.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.
#
##===----------------------------------------------------------------------===##

LLC_OPTS = -f -o=/dev/null -stats -time-passes -regalloc=linearscan
CURDIR := $(shell cd .; pwd)
PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/
RELDIR := $(subst $(PROGDIR),,$(CURDIR))

$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
Output/%.$(TEST).report.txt: Output/%.llvm.bc $(LLC)
-(time -p $(LLC) $(LLC_OPTS) $<) > $@ 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 := $(LLC)
50 changes: 50 additions & 0 deletions TEST.llc.report
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
##=== TEST.jit.report - Report description for jit tests -------*- perl -*-===##
#
# This file defines a report to be generated for the jit test.
#
##===----------------------------------------------------------------------===##

# Sort by name
$SortCol = 1;
$TrimRepeatedPrefix = 1;

sub TotalInstrEliminations {
my ($Cols, $Col) = @_;
$iMov = $Cols->[$Col-2];
$peep = $Cols->[$Col-1];
if ($iMov eq "*") { $iMov = 0; }
if ($peep eq "*") { $peep = 0; }

return $iMov + $peep;
}

# 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
["Total" , 'real ([0-9.]+)'],
["CodeGen", 'Total Execution Time: ([0-9.]+)'],
["InstSel", '([0-9.]+) \([^)]+\)[ 0-9A-Za-z]+Instruction Selection'],
["LiveVar", '([0-9.]+) \([^)]+\)[ 0-9A-Za-z]+Live Variable'],
["RA" , '([0-9.]+) \([^)]+\)[ 0-9A-Za-z]+Register Allocator'],
["FPStack", '([0-9.]+) \([^)]+\)[ 0-9]+X86 FP Stackifier'],
["Peep" , '([0-9.]+) \([^)]+\)[- 0-9]+X86 Peephole Optimizer'],
[],
# Sizes
["#MCInsts", '([0-9]+).*Number of machine instrs printed'],
["#Int" , '([0-9]+).*Number of intervals'],
[],
# Number of transformations
["#spill" , '([0-9]+).*Number of registers spilled'],
["#reload", '([0-9]+).*Number of registers reloaded'],
["#fp" , '([0-9]+).*Number of floating point instructions'],
["#fxch" , '([0-9]+).*Number of fxch instructions inserted'],
["#i-mov" , '([0-9]+).*Number of identity moves eliminated'],
["#peep" , '([0-9]+).*Number of peephole optimization performed'],
["#tot-el", \&TotalInstrEliminations],
[]
);

0 comments on commit af2730f

Please sign in to comment.