[m-rev.] for review: optimize bits_per_int operations

Ralph Becket rafe at csse.unimelb.edu.au
Tue Dec 19 14:37:13 AEDT 2006


Zoltan Somogyi, Tuesday, 19 December 2006:
> Ihave two questions for the reviewers of this diff. First, should the new
> option default to --cross-compiling or --no-cross-compiling? The former is
> safer, the second yields faster code. Second, the new option should of course
> be mentioned in the user guide, but exactly where?

I think --no-cross-compiling is a reasonable default.  If I am cross
compiling, I expect to have to take extra care over compiler flags.

> Optimize the functions involving int.bits_per_int, since doing this can speed
> up sparse_bitset.m.
> 
> compiler/options.m:
> 	Add an option that says whether we are cross-compiling, since our
> 	optimizations work only int.bits_per_int returns the same in the
> 	running program as in the compiler that generates its code.
> 
> compiler/simplify.m:
> 	If we are not cross compiling, replace calls to the functions
> 	involving bits_per_int whose other arguments have unknown values
> 	with simpler, faster operations, one of whose operands is the
> 	compiler's value for bits_per_int.
> 
> 	Shift some work from const_prop to simplify, since the code to do the
> 	above needs it also.
> 
> compiler/const_prop.m:
> 	If we are not cross compiling, evaluate calls to the functions
> 	involving bits_per_int whose other arguments have known values.
> 
> compiler/add_pragma.m:
> 	Just as we report errors for attempts to define builtins via clauses,
> 	report errors for attempts to define builtins via foreign_procs.
> 
> compiler/hlds_module.m:
> 	Factor out some common code.
> 
> compiler/Mercury.options:
> 	Turn on the new optimizations for sparse_bitset.m.
> 
> mdbcomp/prim_data.m:
> 	Provide a utility predicate for recognizing standard library modules,
> 	for use in simplify.m.
> 
> cvs diff: Diffing compiler
> Index: compiler/call_gen.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/call_gen.m,v
> retrieving revision 1.188
> diff -u -b -r1.188 call_gen.m
> --- compiler/call_gen.m	14 Dec 2006 04:35:44 -0000	1.188
> +++ compiler/call_gen.m	16 Dec 2006 17:38:10 -0000
> @@ -103,7 +103,7 @@
>      code_info.get_module_info(!.CI, ModuleInfo),
>      Address = make_proc_entry_label(!.CI, ModuleInfo, PredId, ProcId, yes),
>      code_info.get_next_label(ReturnLabel, !CI),
> -    call_gen.call_comment(CodeModel, CallComment),
> +    call_gen.call_comment(!.CI, PredId, CodeModel, CallComment),
>      goal_info_get_context(GoalInfo, Context),
>      goal_info_get_goal_path(GoalInfo, GoalPath),
>      CallCode = node([
> @@ -454,11 +454,31 @@
>          FailHandlingCode = empty
>      ).

etc.  I think you've attached the wrong diff for this log file.

--------------------------------------------------------------------------
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