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

Brian Gaeke gaeke at cs.uiuc.edu
Mon Nov 10 01:10:01 PST 2003


Changes in directory reopt/test:

TEST.reopt.Makefile updated: 1.4 -> 1.5

---
Log message:

Link in as many libraries as are needed to get my reoptimizer hacks to link.
Ugh.  Also, pretty up the status messages, and add support for diffing the
output of the reoptimized version against the llc version.


---
Diffs of the changes:  (+26 -14)

Index: reopt/test/TEST.reopt.Makefile
diff -u reopt/test/TEST.reopt.Makefile:1.4 reopt/test/TEST.reopt.Makefile:1.5
--- reopt/test/TEST.reopt.Makefile:1.4	Wed Aug 27 15:40:56 2003
+++ reopt/test/TEST.reopt.Makefile	Mon Nov 10 01:08:51 2003
@@ -4,10 +4,10 @@
 # output is 1) any debug output the reoptimizer outputs, if its debug flags
 #              are set
 #           2) no core dumps unless the unaltered program also dumps core
-#           3) same output as unaltered program
-#
-# Admittedly this is pretty weak but it serves as a kind of "hello
-# world"-level test.
+#           3) same output as program compiled with llc, without reoptimizer
+# This makefile will check 3) for you, which effectively implies checking
+# 2); it will (erroneously) assume things have broken if you turn on
+# debug flags, though.
 #
 ##===----------------------------------------------------------------------===##
 
@@ -21,9 +21,16 @@
 	$(REOPTLIBDIR)/scratchmemory.o
 
 # Libraries that contain common LLVM code the Reoptimizer depends on
-REOPTIMIZER_LLVM_SUPPORT_LIBS = $(DESTLIBCURRENT)/libscalaropts.a \
-	$(DESTLIBCURRENT)/libtransformutils.a $(DESTLIBCURRENT)/vmcore.o \
-	$(DESTLIBCURRENT)/libsupport.a $(DESTLIBCURRENT)/bcreader.o
+REOPTIMIZER_LLVM_SUPPORT_LIBS = \
+	$(DESTLIBCURRENT)/vmcore.o \
+	$(DESTLIBCURRENT)/bcreader.o $(DESTLIBCURRENT)/bcwriter.o \
+	$(DESTLIBCURRENT)/sparc.o $(DESTLIBCURRENT)/sched.o \
+	$(DESTLIBCURRENT)/libsupport.a $(DESTLIBCURRENT)/select.o \
+	$(DESTLIBCURRENT)/target.o $(DESTLIBCURRENT)/libregalloc.a \
+	$(DESTLIBCURRENT)/livevar.o $(DESTLIBCURRENT)/codegen.o \
+	$(DESTLIBCURRENT)/libscalaropts.a \
+	$(DESTLIBCURRENT)/libtransformutils.a \
+	$(DESTLIBCURRENT)/libanalysis.a
 
 # Solaris libraries that the Reoptimizer depends on
 REOPTIMIZER_SOLARIS_SUPPORT_LIBS = -lcpc -lm -lrt -lmalloc
@@ -40,8 +47,8 @@
 .PRECIOUS: Output/%.out-reopt-llc
 
 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
-test.$(TEST).%: Output/%.out-reopt-llc
-	@echo "========================================="
+test.$(TEST).%: Output/%.diff-reopt-llc
+	@echo "===== Finished running Reoptimizer tests for $(TESTNAME) ====="
 
 # 1. Run the necessary opt passes over the bytecode, then...
 # 1a. Compile it with LLC, using the SPARC backend's special option to
@@ -49,9 +56,10 @@
 # compile times significantly.
 $(PROGRAMS_TO_TEST:%=Output/%.reopt-llc.s): \
 Output/%.reopt-llc.s: Output/%.llvm.bc
-	@echo "========================================="
-	@echo "Compiling Reoptimizer version of '$(TESTNAME)'"
-	-$(LOPT) -q -inline -lowerswitch -branch-combine -emitfuncs -instloops $< | $(LLC) $(LLCFLAGS) -disable-sched -disable-strip -f -enable-maps -o $@
+	@echo "===== Building Reoptimizer version of $(TESTNAME) ====="
+	-$(LOPT) -q -inline -lowerswitch -branch-combine -emitfuncs -instloops $< |\
+	$(LLC) $(LLCFLAGS) -disable-sched -disable-strip -f -enable-maps \
+	-save-ra-state -o $@
 
 # 2. Link the instrumented binary with the necessary parts of the
 # compiler.
@@ -62,7 +70,11 @@
 # 3. Run the reoptimized version.
 $(PROGRAMS_TO_TEST:%=Output/%.out-reopt-llc): \
 Output/%.out-reopt-llc: Output/%.reopt-llc
-	@echo "Running Reoptimizer version of '$(TESTNAME)'"
+	@echo "===== Running Reoptimizer version of $(TESTNAME) ====="
 	-$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
-	@echo "Output in" `pwd`/$@
+
+# 4. Diff it against the plain old llc version
+$(PROGRAMS_TO_TEST:%=Output/%.diff-reopt-llc): \
+Output/%.diff-reopt-llc: Output/%.out-llc Output/%.out-reopt-llc
+	-$(DIFFPROG) reopt-llc $* $(HIDEDIFF)
 





More information about the llvm-commits mailing list