[m-dev.] diff: enable eager code generator

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Oct 2 13:41:56 AEDT 2000


Benchmarks I have done recently confirm the results I got earlier on unfinished
versions of the eager code generator: the eager code generator generates better
code at all optimization levels except those involving value numbering. I
believe the reason for that is that value numbering generates code that stores
values in temporary registers tempN, while the eager code generator only uses 
the usual Mercury abstract machine registers rN. This can be significant on
x86s, since we have only one real rN register on that platform. (I will look
into using tempN registers later.)

Accordingly, after the benchmark results here is a diff to enable the eager
code generator where appropriate.

Zoltan.

EXTRA_MCFLAGS = -O-1 --lazy-code
mercury_compile.01     65.30
EXTRA_MCFLAGS = -O-1 --no-lazy-code
mercury_compile.02     56.34
EXTRA_MCFLAGS = -O0 --lazy-code
mercury_compile.03     52.00
EXTRA_MCFLAGS = -O0 --no-lazy-code
mercury_compile.04     51.44
EXTRA_MCFLAGS = -O1 --lazy-code
mercury_compile.05     51.77
EXTRA_MCFLAGS = -O1 --no-lazy-code
mercury_compile.06     51.36
EXTRA_MCFLAGS = -O2 --lazy-code
mercury_compile.07     43.71
EXTRA_MCFLAGS = -O2 --no-lazy-code
mercury_compile.08     42.56
EXTRA_MCFLAGS = -O3 --lazy-code
mercury_compile.09     42.95
EXTRA_MCFLAGS = -O3 --no-lazy-code
mercury_compile.10     42.31
EXTRA_MCFLAGS = -O4 --lazy-code
mercury_compile.11     41.76
EXTRA_MCFLAGS = -O4 --no-lazy-code
mercury_compile.12     42.03
EXTRA_MCFLAGS = -O5 --lazy-code
mercury_compile.13     41.34
EXTRA_MCFLAGS = -O5 --no-lazy-code
mercury_compile.14     42.05
EXTRA_MCFLAGS = --trace deep --lazy-code
mercury_compile.15     81.19
EXTRA_MCFLAGS = --trace deep --no-lazy-code
mercury_compile.16     80.07

Enable the eager code generator where appropriate.

compiler/options.m:
	Make eager code generation the default; switch back to laxy code
	generation at optimization levels 4 and higher.

compiler/handle_options.m:
	Regardless of optimization level, use eager code generation
	if debugging is enabled.

cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.91
diff -u -r1.91 handle_options.m
--- compiler/handle_options.m	2000/09/27 05:22:03	1.91
+++ compiler/handle_options.m	2000/09/30 22:22:22
@@ -388,6 +388,9 @@
 			% we don't have to discover this fact anew
 			% for each procedure.
 		globals__io_set_option(optimize_value_number, bool(no)),
+			% Without value numbering, the eager code generator
+			% generates better code than the lazy code generator.
+		globals__io_set_option(lazy_code, bool(no)),
 			% The following options cause the info required
 			% by tracing to be generated.
 		globals__io_set_option(trace_stack_layout, bool(yes)),
Index: compiler/options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.291
diff -u -r1.291 options.m
--- compiler/options.m	2000/09/27 05:22:29	1.291
+++ compiler/options.m	2000/09/30 22:19:30
@@ -590,7 +590,7 @@
 	low_level_debug		-	bool(no),
 	trad_passes		-	bool(yes),
 	polymorphism		-	bool(yes),
-	lazy_code		-	bool(yes),
+	lazy_code		-	bool(no),
 	reclaim_heap_on_failure	-	bool_special,
 	reclaim_heap_on_semidet_failure	-	bool(yes),
 	reclaim_heap_on_nondet_failure	-	bool(yes),
@@ -1425,6 +1425,7 @@
 % and increases the inlining thresholds
 
 opt_level(4, _, [
+	lazy_code		-	bool(yes),
 	optimize_value_number	-	bool(yes),
 	inline_simple_threshold	-	int(8),
 	inline_compound_threshold -	int(20)
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing trax
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list