Add --slow (and --fast) options to validate
authorIan Lynagh <igloo@earth.li>
Tue, 1 Jul 2008 17:59:27 +0000 (17:59 +0000)
committerIan Lynagh <igloo@earth.li>
Tue, 1 Jul 2008 17:59:27 +0000 (17:59 +0000)
slow mode is 14% slower than normal. It uses -DDEBUG for the stage 2
compiler, and -XGenerics for the stage 2 compiler and the libraries.
I believe that most of the slowdown is actually caused by -XGenerics
rather than -DDEBUG.

mk/validate-settings.mk
validate

index b49ba59..83995e5 100644 (file)
@@ -5,7 +5,8 @@ HADDOCK_DOCS    = YES
 SRC_CC_OPTS     = $(WERROR)
 SRC_HC_OPTS     = $(WERROR) -H64m -O0 -fasm
 GhcStage1HcOpts = -O -fasm
-GhcStage2HcOpts = -O0 -fasm $(ValidateHpcFlags)
+
+GhcStage2HcOpts = -O0 -fasm
 GhcLibHcOpts    = -O -fasm -dcore-lint
 GhcLibWays      =
 SplitObjs       = NO
@@ -13,3 +14,11 @@ NoFibWays       =
 STRIP           = :
 GhcBootLibs     = YES
 
+ifeq "$(ValidateHpc)" "YES"
+GhcStage2HcOpts += -fhpc -hpcdir $(FPTOOLS_TOP_ABS)/testsuite/hpc_output/
+endif
+ifeq "$(ValidateSlow)" "YES"
+GhcStage2HcOpts += -XGenerics -DDEBUG
+GhcLibHcOpts    += -XGenerics
+endif
+
index 866ab09..d6f6adb 100644 (file)
--- a/validate
+++ b/validate
@@ -6,13 +6,18 @@
 #   --testsuite-only: don't build the compiler, just run
 #                     the test suite
 #   --hpc:            build stage2 with -fhpc, and see how much of the
-#                     compiler the test suite covers
+#                     compiler the test suite covers.
+#                     2008-07-01: 63% slower than the default.
+#   --fast:           Default. Opposite to --slow.
+#   --slow:           Build stage2 with -DDEBUG.
+#                     2008-07-01: 14% slower than the default.
 
 set -e
 
 no_clean=0
 testsuite_only=0
-hpc=0
+hpc=NO
+slow=NO
 
 while [ $# -gt 0 ]
 do
@@ -24,7 +29,13 @@ do
         testsuite_only=1
         ;;
     --hpc)
-        hpc=1
+        hpc=YES
+        ;;
+    --slow)
+        slow=YES
+        ;;
+    --fast)
+        slow=NO
         ;;
     *)
         echo "Bad argument: $1" >&2
@@ -59,15 +70,10 @@ sh boot
 
 thisdir=`utils/pwd/pwd forwardslash`
 
-if [ "$hpc" = 1 ]
-then
-    hpcflags="ValidateHpcFlags=-fhpc -hpcdir $thisdir/testsuite/hpc_output/"
-fi
-
-make Validating=YES -j$threads ${hpcflags+"$hpcflags"}
+make Validating=YES -j$threads ValidateHpc=$hpc ValidateSlow=$slow
 fi # testsuite-only
 
-if [ "$hpc" = 1 ]
+if [ "$hpc" = YES ]
 then
     # XXX With threads we'd need to give a different tix file to each thread
     #     and then sum them up at the end
@@ -79,7 +85,7 @@ fi
 
 make Validating=YES -C testsuite/tests/ghc-regress fast stage=2 CLEANUP=1 THREADS=$threads 2>&1 | tee testlog
 
-if [ "$hpc" = 1 ]
+if [ "$hpc" = YES ]
 then
     utils/hpc/hpc markup --hpcdir=. --srcdir=compiler --srcdir=testsuite/hpc_output --destdir=testsuite/hpc_output testsuite/hpc_output/ghc.tix
 fi