[m-dev.] for review: `possible' alias analysis stage

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Feb 26 01:49:37 AEDT 2000


On 21-Feb-2000, Nancy MAZUR <nancy at cs.mu.OZ.AU> wrote:
> 
> here's the code.
> 
> waiting to be shot (can I be blindfolded, please?),

I'll try to shoot gently ;-)

> Added `possible' alias analysis stage (before unique modes analysis).

What's the rationale for this change?
Well, OK, I'm pretty sure there is a good rationale ;-)
But the log message should explain it.

The only exception is cases where the rationale is very obvious,
e.g. where the change is something like "fix bug" or "add optimization".
But it is not immediately obvious why possible-alias analysis
would be useful.

One of the reasons why it is important to explain the rationale
is that often things change.  If, for example, possible alias
analysis was added to support HAL, and then later it turned out
that HAL didn't need possible alias analysis after all, 
we might want to remove the possible alias analysis stuff.
But if the log message doesn't say why it was added, then
we will have a hard time figuring out whether it will be
OK to remove it.

> compiler/handle_options.m
> compiler/hlds_out.m 
> 	added option/handler to print alias information in hlds_dumps
> 	(`kulalias' or `k')

To ensure that these log messages are easily machine-parsable,
please ensure that you stick exactly to the format used by
other log messages.  In particular:

	- "estimated hours taken:" should start with
	  a capital "E".

	- after each file name, there should be a colon (":").

Also, it's nice if the log messages are properly punctuated
(e.g. starting with a capital letter and ending with a full stop).

> compiler/prog_data.m
> compiler/prog_io_pragma.m
> compiler/module_qual.m
> compiler/modules.m
> compiler/mercury_to_mercury.m
> compiler/make_hlds.m
> 	added new prog_data__pragma_type constructor: ka_alias_info/5
> 	added new pragma-declaration: ka_alias_info/3
> 		:- pragma ka_alias_info( <small pred declaration>,
> 			vars( <list of headvars> ), 
> 			maybe( <printed alias-information> ) ).
> 		This pragma-declaration is not intended to be 
> 		used directly by the programmer.

I don't think using the abbreviation `ka' (for "KUL alias")
here is a good idea.  Likewise for the filenames ka_*.m
and for the file extension `.ka'.
I think it would be better to use an abbreviation that gives
information about what the declaration or file is for, rather
than about where it was developed.  For example, you could
use `pa' (for "possible alias").

> ===
> new files:  (ka = KUL-alias)
> compiler/ka_alias_as.m  : definition of the abstract substitution and
> 			 it's primitive operations
> compiler/ka_run.m : main module for effectively running the analysis pass
> compiler/ka_util.m : some extra types/procedures, mainly definition of
> 		a fixpoint table.

To ensure that these log messages are easily machine-parsable,
please ensure that you stick exactly to the format used by
other log messages:

	<directory/file>:
		<detailed description of changes>

Note that the detailed description starts on a new line,
and is indented by just one tab.

It's best not to use "new files:", since that might be misinterpreted
(by software parsing the log messages) as a file name.  Instead, for the
new files you can insert "New file." at the start of the <detailed
description of changes> for each such file.

> Index: handle_options.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
> retrieving revision 1.88
> diff -u -r1.88 handle_options.m
> --- handle_options.m	2000/01/10 05:26:18	1.88
> +++ handle_options.m	2000/02/08 00:15:19
> @@ -854,9 +854,11 @@
>  :- pred convert_dump_alias(string, string).
>  :- mode convert_dump_alias(in, out) is semidet.
>  
> -convert_dump_alias("ALL", "abcdfgilmnprstuvCIMPTU").
> -convert_dump_alias("all", "abcdfgilmnprstuvCMPT").
> +convert_dump_alias("ALL", "abcdfgiklmnprstuvCIMPTU").
> +convert_dump_alias("all", "abcdfgiklmnprstuvCMPT").
>  convert_dump_alias("codegen", "dfnprsu").
>  convert_dump_alias("vanessa", "ltuCIU").
>  convert_dump_alias("paths", "cP").
>  convert_dump_alias("petdr", "din").
> +convert_dump_alias("kulalias", "k").

Continuing with my earlier suggestion about naming things
for what they are rather than where they were developed,
it would probably be better to use "A" for "possible alias"
information (unfortunately both p and P are already taken)
rather than "k".

[... to be continued ...]

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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