[m-rev.] changes I committed on Dec 27

Zoltan Somogyi zs at csse.unimelb.edu.au
Wed Jan 3 15:59:13 AEDT 2007


I committed several changes on Dec 27, but the wonderful filesystem upgrade
ensured I had no access to any file in my home directory, including my mail
setup, on that day. I therefore couldn't send messages to mercury-reviews.

Here are the log messages of those changes. The diffs are in ~zs/mer/DEC27
if anyone wants to review any of them.

Zoltan.

---------------------------------------------------------------

compiler/table_gen.m:
compiler/unused_args.m:
	Instead of printing each error message immediately, pass them back to
	mercury_compile.m to print them all at once.

compiler/mercury_compile.m:
	Do the printing.
	
compiler/hlds_goal.m:
compiler/inst_graph.m:
library/float.m:
library/int.m:
library/math.m:
	Rename some predicates to avoid ambiguity.

compiler/*.m:
	Conform to the changes above.

---------------------------------------------------------------

compiler/use_local_vars.m:
	This module looks for an optimizes three code patterns, only one
	of which depends on knowledge of which registers are live at which
	labels. So instead of giving up totally if we cannot compute the
	live register map (due to the presence of foreign language code),
	give up on only the optimization that requires the unavailable
	information.

compiler/basic_block.m:
	Fix grammar in a comment.

compiler/mercury_compile.m:
	Add a missing progress message.

---------------------------------------------------------------

Fix some problems with my recent change to simplify to optimize the handling
of calls to the functions in int.m involving the bits_per_int platform-specific
constant.

One problem was that the transformation in simplify.m worked only if it could
find in the HLDS's predicate table the functions it needed (unchecked_quotient,
unchecked_remainder and *), but these were deleted earlier as dead predicates.
The fix is to prevent dead_proc_elim from deleting these predicates. (Three
small predicates aren't a problem for memory consumption.)

Another problem was that some of the calls to the library predicates that
simplify was trying to optimize were introduced as part of intermodule inlining
*after* the first simplify pass, and inlining also replaced the calls with
their definitions, which are foreign_procs. The fix is to apply the same
transformation to the foreign_proc form of the call as to the plain_call form.

compiler/dead_proc_elim.m:
	Do not eliminate predicates that simplify may introduce calls to.

	Rename several predicates to avoid ambiguities, and some function
	symbols and variables to make their purpose clearer.

	Instead of printing out warning messages on the fly, return them to be
	printed all at once by mercury_compile.m.

compiler/simplify.m:
	Export a predicate that dead_proc_elim can use to find out which
	predicates may have calls introduced to them.

	Implement the fix of the second problem noted above.

compiler/mercury_compile.m:
compiler/inlinig.m:
	Conform to the changes in dead_proc_elim.

compiler/error_util.m:
	Add a phase for dead_proc_elim, since that phase can now also generate
	messages.

compiler/pred_table.m:
	Improve some documentation.

---------------------------------------------------------------

compiler/typecheck_errors.m:
	When printing error messages about mismatches between actual and
	expected types, eliminate duplicates not on the basis of the raw
	data, but on the basis of what is to be printed. This is an
	improvement, because irrelevant differences in the raw data (e.g. the
	numbers of variables in varsets) were causing us to print duplicates.

tests/invalid/actual_expected.{m,err_exp}:
	New test case to test the new error message. It is an extract from
	use_local_vars.m, which is where I found the problem.

tests/invalid/Mmakefile:
	Enable the new test case.

---------------------------------------------------------------

Make the system compile programs using minimal model tabling cleanly
in .mmos grades. (They still do not work, since the .mmos grade's
implementation is not yet complete.)

compiler/prog_data.m:
	Split the eval method for own stack minimal model tabling in two:
	one for the consumer predicate, and one for the generator, since they
	have distinct properties.

	Add a utility predicate for use by llds_out and ml_code_gen.

compiler/prog_out.m:
	Split the predicate for converting an eval method to a string into two:
	one used for debugging purposes (which must be full of information),
	and one used for generating the names of pragmas (which must conform
	to the user-level syntax).

compiler/table_gen.m:
	Have the own stack transformation generate the proc_table_info now
	required to generate the variable containing the root of the call
	table, as well as the information describing the structure of the call
	and answer tables.

	Fix some software rot.

compiler/hlds_out.m:
	Print out the tabling information that may be attached to proc_infos.

compiler/llds_out.m:
compiler/ml_code_gen.m:
	Factor out some common code from these modules, and move it to
	prog_data.m.

compiler/add_pragma.m:
compiler/hlds_pred.m:
compiler/layout_out.m:
	Conform to the changes above.

runtime/mercury_mm_own_stacks.[ch]:
	Record the name of the predicate in generator and consumer structures,
	for debugging purposes (they can be taken out once the system works).

	Record the context in each consumer.

	Fix a link error by providing a dummy statistics printing predicate.

	Fix a cut-and-paste bug (wrong macro name guarding the handwritten
	C module).

runtime/mercury_tabling_preds.h:
	Implement some predicates needed by the own stack transformation.

	Fix some software rot.

runtime/mercury_debug.c:
	Avoid warnings from the C compiler.

runtime/mercury_context.c:
runtime/mercury_engine.h:
runtime/mercury_wrapper.c:
	Minor style fixes.

runtime/mercury_stack_layout.h:
trace/mercury_trace.c:
trace/mercury_trace_cmd_developer.c:
	Conform to the splitting of the own stack eval method into two.

---------------------------------------------------------------

library/Mercury.options:
	Compile sparse_bitset.m and tree_bitset.m with
	--optimize-constant-propagation, which enables the optimizations
	in simplify.m for operations involving bits_per_int, which were
	designed for this purpose.

	Compile them also with --use-atomic-cells, to enables to use plain
	Mercury code instead of foreign procs to allocate nodes containing
	bitsets.

	These changes lead to a speedup of about 1.5% in compiling
	training_cars_full.m, from 97.3 seconds to 95.8 seconds.

library/sparse_bitset.m:
library/tree_bitset.m:
	Use Mercury code instead of foreign_procs to allocate nodes containing
	bitsets.

	I tried commenting out the sanity checks still left in tree_bitset.m,
	but this lead to a speedup of only 0.1%, so I left them in.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list