[llvm-commits] [parallel] CVS: llvm/test/Programs/TEST.vtl.Makefile Makefile.programs TEST.jit.report TEST.llc.Makefile TEST.llc.report TEST.nightly.Makefile TEST.nightly.report TEST.micro.Makefile TEST.micro.report

Misha Brukman brukman at cs.uiuc.edu
Mon Mar 1 18:29:51 PST 2004


Changes in directory llvm/test/Programs:

TEST.vtl.Makefile added (r1.3.2.1)
Makefile.programs updated: 1.109 -> 1.109.2.1
TEST.jit.report updated: 1.3 -> 1.3.2.1
TEST.llc.Makefile updated: 1.2 -> 1.2.2.1
TEST.llc.report updated: 1.2 -> 1.2.2.1
TEST.nightly.Makefile updated: 1.26 -> 1.26.2.1
TEST.nightly.report updated: 1.21 -> 1.21.2.1
TEST.micro.Makefile (r1.4) removed
TEST.micro.report (r1.4) removed

---
Log message:

Merge from trunk

---
Diffs of the changes:  (+167 -30)

Index: llvm/test/Programs/TEST.vtl.Makefile
diff -c /dev/null llvm/test/Programs/TEST.vtl.Makefile:1.3.2.1
*** /dev/null	Mon Mar  1 17:59:19 2004
--- llvm/test/Programs/TEST.vtl.Makefile	Mon Mar  1 17:59:09 2004
***************
*** 0 ****
--- 1,66 ----
+ ##===- test/Programs/TEST.vtl.Makefile ---------------------*- Makefile -*-===##
+ #
+ # Makefile for getting performance metrics using Intel's VTune.
+ #
+ ##===----------------------------------------------------------------------===##
+ 
+ TESTNAME = $*
+ 
+ VTL := /opt/intel/vtune/bin/vtl
+ 
+ #
+ # Events: These will need to be modified for every different CPU that is used
+ # (i.e. the Pentium 3 on Cypher has a different set of available events than
+ # the Pentium 4 on Zion).
+ #
+ P4_EVENTS := "-ec en='2nd Level Cache Read Misses' en='2nd-Level Cache Read References'"
+ P3_EVENTS := "-ec en='L2 Cache Request Misses (highly correlated)'"
+ 
+ EVENTS := $(P4_EVENTS)
+ 
+ #
+ # Generate events for LLC
+ #
+ #$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+ #test.$(TEST).%: Output/%.llc
+ 	#@echo "========================================="
+ 	#@echo "Running '$(TEST)' test on '$(TESTNAME)' program"
+ 	#$(VERB) $(VTL) activity $* -d 50 -c sampling -o $(EVENTS) -app $<
+ 	#-$(VERB) $(VTL) run $*
+ 	#-$(VERB) $(VTL) view > $@
+ 	#$(VERB)  $(VTL) delete $* -f
+ 
+ test:: $(PROGRAMS_TO_TEST:%=test.$(TEST).pa.%)
+ 
+ #
+ # Generate events for Pool Allocated CBE
+ #
+ $(PROGRAMS_TO_TEST:%=test.$(TEST).pa.%): \
+ test.$(TEST).pa.%: Output/%.poolalloc.cbe
+ 	@echo "========================================="
+ 	@echo "Running '$(TEST)' test on '$(TESTNAME)' program"
+ ifeq ($(RUN_OPTIONS),)
+ 	$(VERB) cat $(STDIN_FILENAME) | $(VTL) activity $* -d 50 -c sampling -o $(EVENTS) -app $<
+ else
+ 	$(VERB) cat $(STDIN_FILENAME) | $(VTL) activity $* -d 50 -c sampling -o $(EVENTS) -app $<,"$(RUN_OPTIONS)"
+ endif
+ 	-$(VERB) $(VTL) run $*
+ 	-$(VERB) $(VTL) view > $@
+ 	$(VERB)  $(VTL) delete $* -f
+ 
+ #
+ # Generate events for Pool Allocated CBE
+ #
+ $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+ test.$(TEST).%: Output/%.cbe
+ 	@echo "========================================="
+ 	@echo "Running '$(TEST)' test on '$(TESTNAME)' program"
+ ifeq ($(RUN_OPTIONS),)
+ 	$(VERB) cat $(STDIN_FILENAME) | $(VTL) activity $* -d 50 -c sampling -o $(EVENTS) -app $<
+ else
+ 	$(VERB) cat $(STDIN_FILENAME) | $(VTL) activity $* -d 50 -c sampling -o $(EVENTS) -app $<,"$(RUN_OPTIONS)"
+ endif
+ 	-$(VERB) $(VTL) run $*
+ 	-$(VERB) $(VTL) view > $@
+ 	$(VERB)  $(VTL) delete $* -f
+ 


Index: llvm/test/Programs/Makefile.programs
diff -u llvm/test/Programs/Makefile.programs:1.109 llvm/test/Programs/Makefile.programs:1.109.2.1
--- llvm/test/Programs/Makefile.programs:1.109	Tue Jan 20 00:54:02 2004
+++ llvm/test/Programs/Makefile.programs	Mon Mar  1 17:59:09 2004
@@ -107,6 +107,10 @@
 LLCLSDIFFS  := $(addsuffix .diff-llc-ls, $(PREFIXED_PROGRAMS_TO_TEST))
 CBEDIFFS  := $(addsuffix .diff-cbe, $(PREFIXED_PROGRAMS_TO_TEST))
 
+# Profiles for the program.
+PROFOUTPUT := $(addsuffix .prof, $(PREFIXED_PROGRAMS_TO_TEST))
+PRINTPROFOUTPUT := $(addsuffix .printprof, $(PREFIXED_PROGRAMS_TO_TEST))
+
 # Build Program outputs:
 .PRECIOUS: Output/%.out-lli Output/%.out-jit Output/%.out-llc Output/%.out-llc-ls
 .PRECIOUS: Output/%.out-nat Output/%.out-cbe
@@ -119,6 +123,9 @@
 # Regardless of what other options are specified, build the program's bytecode
 # representation.
 all:: $(BYTECODE)
+profile:: $(PROFOUTPUT)
+print-profile:: $(PRINTPROFOUTPUT)
+
 
 ifdef RUN_GCC_ONLY
 DISABLE_DIFFS = 1
@@ -171,7 +178,7 @@
 ifdef ENABLE_LINEARSCAN
 all:: $(LLCLSDIFFS)
 endif
-endif
+endif#DISABLE_LLC_DIFFS
 
 ifndef DISABLE_CBE_DIFFS
 all:: $(CBEDIFFS)
@@ -180,16 +187,16 @@
 ifdef TARGET_HAS_JIT
 ifndef DISABLE_JIT
 all:: $(JITDIFFS)
-endif
 ifdef ENABLE_LINEARSCAN
 all:: $(JITLSDIFFS)
 endif
-endif
+endif#DISABLE_JIT
+endif#TARGET_HAS_JIT
 
 ifdef ENABLE_LLI
 all:: $(LLIDIFFS)
 endif
-endif
+endif#DISABLE_DIFFS
 
 # Given a version of the entire program linked together into a single unit of
 # raw output from the C frontend, optimize it.
@@ -201,6 +208,7 @@
 Output/%.llvm.stripped.bc: Output/%.llvm.bc $(LOPT)
 	$(LOPT) -mstrip $< -o $@ -f
 
+
 ifndef DISABLE_FOR_LLVM_PROGRAMS
 # Rule to produce final program bytecode file from linked, optimized, bytecode.
 # Link the program to the libraries it uses, then perform postlink
@@ -208,7 +216,7 @@
 
 $(PROGRAMS_TO_TEST:%=Output/%.llvm.bc): \
 Output/%.llvm.bc: Output/%.linked.bc $(LGCCLDPROG)
-	$(LGCCLD) -disable-inlining $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.llvm
+	$(LGCCLD) $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.llvm
 ifneq ($(OPTPASSES),)
 	$(LOPT) -q $(OPTPASSES) < $@ > $@.tmp
 	$(MV) -f $@.tmp $@
@@ -216,29 +224,42 @@
 
 $(PROGRAMS_TO_TEST:%=Output/%.llvm): \
 Output/%.llvm: Output/%.linked.bc $(LGCCLDPROG)
-	$(LGCCLD) -disable-inlining $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.llvm
+	$(LGCCLD) $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.llvm
 ifneq ($(OPTPASSES),)
 	$(LOPT) -q $(OPTPASSES) < $@ > $@.tmp
 	$(MV) -f $@.tmp $@
 endif
+
+$(PROGRAMS_TO_TEST:%=Output/%.noopt-llvm.bc): \
+Output/%.noopt-llvm.bc: Output/%.linked.rbc $(LGCCLDPROG)
+	$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.noopt-llvm
+
+$(PROGRAMS_TO_TEST:%=Output/%.noopt-llvm): \
+Output/%.noopt-llvm: Output/%.linked.rbc $(LGCCLDPROG)
+	$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.noopt-llvm
 endif   # ifndef DISABLE_FOR_LLVM_PROGRAMS
 
 # Targets to get the pass arguments that gccas and gccld are using...
-Output/gccas-pass-args: $(LGCCAS)
+Output/gccas-pass-args: $(LGCCAS) Output/.dir
 	$(LGCCAS) /dev/null -o /dev/null -debug-pass=Arguments > $@.1 2>&1
 	sed 's/Pass Arguments: //' < $@.1 > $@
-Output/gccld-pass-args: $(LGCCLDPROG)
+Output/gccld-pass-args: $(LGCCLDPROG) Output/.dir
 	$(LLVMAS) < /dev/null > Output/gccld.test.bc
-	$(LGCCLD) -disable-inlining Output/gccld.test.bc -o Output/gccld.test-out -debug-pass=Arguments > $@.1 2>&1
+	$(LGCCLD) Output/gccld.test.bc -o Output/gccld.test-out -debug-pass=Arguments > $@.1 2>&1
 	sed 's/Pass Arguments: //' < $@.1 > $@
 
+# If the program requires exception handling support, enable (potentially
+# expensive) support for it.
+ifdef REQUIRES_EH_SUPPORT
+LLCFLAGS += -enable-correct-eh-support
+endif
 
 #
 # Rules to compile the program for the C Back End
 #
 $(PROGRAMS_TO_TEST:%=Output/%.cbe.c): \
-Output/%.cbe.c: Output/%.llvm.bc $(LDIS)
-	-$(LDIS) -c < $< > $@
+Output/%.cbe.c: Output/%.llvm.bc $(LLC)
+	-$(LLC) $(LLCFLAGS) -march=c $< -o $@ -f
 
 $(PROGRAMS_TO_TEST:%=Output/%.cbe): \
 Output/%.cbe: Output/%.cbe.c
@@ -281,7 +302,13 @@
 
 LLI_OPTS = -force-interpreter=true $(EXTRA_LLI_OPTS)
 JIT_OPTS = -force-interpreter=false $(EXTRA_LLI_OPTS)
-JIT_LS_OPTS = -force-interpreter=false -regalloc=linearscan $(EXTRA_LLI_OPTS)
+
+
+# If the program requires exception handling support, enable (potentially
+# expensive) support for it.
+ifdef REQUIRES_EH_SUPPORT
+JIT_OPTS += -enable-correct-eh-support
+endif
 
 native: $(PROGRAMS_TO_TEST:%=Output/%.native)
 stripped-bytecode:: $(PROGRAMS_TO_TEST:%=Output/%.llvm.stripped.bc)
@@ -308,7 +335,7 @@
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-jit-ls): \
 Output/%.out-jit-ls: Output/%.llvm.bc $(LLI)
-	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $(LLI) $(JIT_LS_OPTS) $< $(RUN_OPTIONS)
+	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $(LLI) -regalloc=linearscan $(JIT_OPTS) $< $(RUN_OPTIONS)
 ifdef PROGRAM_REQUIRED_TO_EXIT_OK
 	@if test \! -f $@.exitok; then echo "TEST (jit-ls): $* FAILED!"; rm -f $@; fi
 endif
@@ -332,12 +359,12 @@
 
 # Rules to bugpoint the GCCAS, GCCLD, LLC, or LLI commands...
 $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-gccas): \
-Output/%.bugpoint-gccas: Output/%.linked.rll $(LBUGPOINT) \
+Output/%.bugpoint-gccas: Output/%.noopt-llvm.bc $(LBUGPOINT) \
                          Output/gccas-pass-args Output/%.out-nat
 	$(LBUGPOINT) $< `cat Output/gccas-pass-args` $(BUGPOINT_OPTIONS)
 
 $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-gccld): \
-Output/%.bugpoint-gccld: Output/%.linked.bc $(LBUGPOINT) \
+Output/%.bugpoint-gccld: Output/%.noopt-llvm.bc $(LBUGPOINT) \
                          Output/gccld-pass-args Output/%.out-nat
 	$(LBUGPOINT) $< `cat Output/gccld-pass-args` $(BUGPOINT_OPTIONS)
 
@@ -349,8 +376,32 @@
 Output/%.bugpoint-jit: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat
 	$(LBUGPOINT) $< -run-jit $(BUGPOINT_OPTIONS)
 
+
+LIBPROFILESO = $(LEVEL)/lib/Debug/libprofile_rt.so
+
+$(PROGRAMS_TO_TEST:%=Output/%.prof): \
+Output/%.prof: Output/%.llvm-prof.bc Output/%.out-nat $(LIBPROFILESO)
+	@rm -f $@
+	-$(RUNSAFELY) $(STDIN_FILENAME) Output/$*.out-prof $(LLI) $(JIT_OPTS) \
+            -fake-argv0 'Output/$*.llvm.bc' -load $(LIBPROFILESO) $< -llvmprof-output $@ $(RUN_OPTIONS)
+	@cmp -s Output/$*.out-prof Output/$*.out-nat || \
+		printf "***\n***\n*** WARNING: Output of profiled program (Output/$*.out-prof)\n*** doesn't match the output of the native program (Output/$*.out-nat)!\n***\n***\n";
+
 endif
 
+
+#
+# Rules to generate profiling information
+#
+$(PROGRAMS_TO_TEST:%=Output/%.llvm-prof.bc): \
+Output/%.llvm-prof.bc: Output/%.llvm.bc
+	$(LOPT) -insert-block-profiling $< -o $@ -f
+
+$(PROGRAMS_TO_TEST:%=Output/%.printprof): \
+Output/%.printprof: Output/%.llvm.bc Output/%.prof $(LPROF)
+	$(LPROF) $< Output/$*.prof
+
+
 #
 # Rules to diff test output...
 #
@@ -478,9 +529,9 @@
 TestMakefile := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).Makefile) \
                 $(wildcard $(LEVEL)/projects/*/test/TEST.$(TEST).Makefile)
 TestReport   := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).report) \
-                $(wildcard $(LEVEL)/projects/*/test/TEST.$(TEST).report)
+                $(wildcard $(BUILD_SRC_ROOT)/projects/*/test/TEST.$(TEST).report)
 TestGnuPlot  := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).gnuplot) \
-                $(wildcard $(LEVEL)/projects/*/test/TEST.$(TEST).gnuplot)
+                $(wildcard $(BUILD_SRC_ROOT)/projects/*/test/TEST.$(TEST).gnuplot)
 ifneq ($(strip $(TestMakefile)),)
 -include $(TestMakefile)
 else


Index: llvm/test/Programs/TEST.jit.report
diff -u llvm/test/Programs/TEST.jit.report:1.3 llvm/test/Programs/TEST.jit.report:1.3.2.1
--- llvm/test/Programs/TEST.jit.report:1.3	Thu Dec 18 21:48:48 2003
+++ llvm/test/Programs/TEST.jit.report	Mon Mar  1 17:59:09 2004
@@ -33,8 +33,8 @@
  ["#Glob"   , '([0-9]+).*Number of bytes of global vars'],
  [],
 # Number of transformations
- ["#spill" , '([0-9]+).*Number of registers spilled'],
- ["#reload", '([0-9]+).*Number of registers reloaded'],
+ ["#store" , '([0-9]+).*Number of stores added'],
+ ["#load"  , '([0-9]+).*Number of loads added'],
  ["#fp"    , '([0-9]+).*Number of floating point instructions'],
  ["#fxch"  , '([0-9]+).*Number of fxch instructions inserted'],
  []


Index: llvm/test/Programs/TEST.llc.Makefile
diff -u llvm/test/Programs/TEST.llc.Makefile:1.2 llvm/test/Programs/TEST.llc.Makefile:1.2.2.1
--- llvm/test/Programs/TEST.llc.Makefile:1.2	Wed Jan 14 01:59:18 2004
+++ llvm/test/Programs/TEST.llc.Makefile	Mon Mar  1 17:59:09 2004
@@ -22,6 +22,6 @@
 	@echo "---------------------------------------------------------------"
 	@cat $<
 
-# Define REPORT_DEPENDENCIES so that the report is regenerated if lli changes
+# Define REPORT_DEPENDENCIES so that the report is regenerated if llc changes
 #
 REPORT_DEPENDENCIES := $(LLC)


Index: llvm/test/Programs/TEST.llc.report
diff -u llvm/test/Programs/TEST.llc.report:1.2 llvm/test/Programs/TEST.llc.report:1.2.2.1
--- llvm/test/Programs/TEST.llc.report:1.2	Wed Jan 14 01:59:18 2004
+++ llvm/test/Programs/TEST.llc.report	Mon Mar  1 17:59:09 2004
@@ -36,11 +36,14 @@
  [],
 # Sizes
  ["#MCInsts", '([0-9]+).*Number of machine instrs printed'],
- ["#Int"   ,  '([0-9]+).*Number of intervals'],
+ ["#IntOrig", '([0-9]+).*Number of original intervals'],
+ ["#IntCoal", '([0-9]+).*Number of intervals after coalescing'],
  [],
 # Number of transformations
- ["#spill" , '([0-9]+).*Number of registers spilled'],
- ["#reload", '([0-9]+).*Number of registers reloaded'],
+ ["#store" , '([0-9]+).*Number of stores added'],
+ ["#load"  , '([0-9]+).*Number of loads added'],
+ ["#fold"  , '([0-9]+).*Number of loads/stores folded into instructions'],
+ ["#spill" , '([0-9]+).*Number of register spills'],
  ["#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'],


Index: llvm/test/Programs/TEST.nightly.Makefile
diff -u llvm/test/Programs/TEST.nightly.Makefile:1.26 llvm/test/Programs/TEST.nightly.Makefile:1.26.2.1
--- llvm/test/Programs/TEST.nightly.Makefile:1.26	Thu Dec 18 21:35:27 2003
+++ llvm/test/Programs/TEST.nightly.Makefile	Mon Mar  1 17:59:09 2004
@@ -12,7 +12,7 @@
 
 REPORTS_TO_GEN := compile nat llc cbe jit
 ifdef ENABLE_LINEARSCAN
-REPORTS_TO_GEN += llc-ls
+REPORTS_TO_GEN += llc-ls jit-ls
 endif
 REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN))
 
@@ -117,6 +117,22 @@
 	  echo >> $@;\
 	else  \
 	  echo "TEST-FAIL: jit $(RELDIR)/$*" >> $@;\
+	fi
+
+# JIT-linearscan tests
+$(PROGRAMS_TO_TEST:%=Output/%.nightly.jit-ls.report.txt): \
+Output/%.nightly.jit-ls.report.txt: Output/%.llvm.bc Output/%.exe-jit-ls $(JIT)
+	@echo > $@
+	-head -n 100 Output/$*.exe-jit-ls >> $@
+	@-if test -f Output/$*.exe-jit-ls; then \
+	  echo "TEST-PASS: jit-ls $(RELDIR)/$*" >> $@;\
+	  printf "TEST-RESULT-jit-ls: " >> $@;\
+	  grep "Total Execution Time" $@.info >> $@;\
+	  printf "TEST-RESULT-jit-ls-time: " >> $@;\
+	  grep "^real" Output/$*.out-jit-ls.time >> $@;\
+	  echo >> $@;\
+	else  \
+	  echo "TEST-FAIL: jit-ls $(RELDIR)/$*" >> $@;\
 	fi
 
 # Overall tests: just run subordinate tests


Index: llvm/test/Programs/TEST.nightly.report
diff -u llvm/test/Programs/TEST.nightly.report:1.21 llvm/test/Programs/TEST.nightly.report:1.21.2.1
--- llvm/test/Programs/TEST.nightly.report:1.21	Sun Jan 11 22:13:53 2004
+++ llvm/test/Programs/TEST.nightly.report	Mon Mar  1 17:59:09 2004
@@ -21,8 +21,8 @@
 
 sub GCCCBERatio {
   my ($Cols, $Col) = @_;
-  my $GCC = $Cols->[$Col-5];
-  my $CBE = $Cols->[$Col-4];
+  my $GCC = $Cols->[$Col-6];
+  my $CBE = $Cols->[$Col-5];
   if ($GCC ne "*" and $CBE ne "*" and $CBE != "0") {
     return sprintf("%3.2f", $GCC/$CBE);
   } else {
@@ -32,8 +32,8 @@
 
 sub GCCLLCRatio {
   my ($Cols, $Col) = @_;
-  my $GCC = $Cols->[$Col-6];
-  my $LLC = $Cols->[$Col-4];
+  my $GCC = $Cols->[$Col-7];
+  my $LLC = $Cols->[$Col-5];
   if ($GCC ne "*" and $LLC ne "*" and $LLC != "0") {
     return sprintf("%3.2f", $GCC/$LLC);
   } else {
@@ -43,8 +43,8 @@
 
 sub GCCLLC_LSRatio {
   my ($Cols, $Col) = @_;
-  my $GCC = $Cols->[$Col-7];
-  my $LLC_LS = $Cols->[$Col-4];
+  my $GCC = $Cols->[$Col-8];
+  my $LLC_LS = $Cols->[$Col-5];
   if ($GCC ne "*" and $LLC_LS ne "*" and $LLC_LS != "0") {
     return sprintf("%3.2f", $GCC/$LLC_LS);
   } else {
@@ -73,6 +73,7 @@
  ["LLC"      , 'TEST-RESULT-llc-time: real\s*([.0-9m:]+)', \&FormatTime],
  ["LLC-LS"   , 'TEST-RESULT-llc-ls-time: real\s*([.0-9m:]+)', \&FormatTime],
  ["JIT"      , 'TEST-RESULT-jit-time: real\s*([.0-9m:]+)', \&FormatTime],
+ ["JIT-LS"   , 'TEST-RESULT-jit-ls-time: real\s*([.0-9m:]+)', \&FormatTime],
  ["GCC/CBE"  , \&GCCCBERatio],
  ["GCC/LLC"  , \&GCCLLCRatio],
  ["GCC/LLC-LS"  , \&GCCLLC_LSRatio]





More information about the llvm-commits mailing list