[m-dev.] for review: move tabling builtins into new module
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Sep 21 11:49:46 AEDT 2000
On 20-Sep-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
>
> > Index: compiler/dead_proc_elim.m
> > ===================================================================
> > RCS file: /home/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
> > retrieving revision 1.59
> > diff -u -d -r1.59 dead_proc_elim.m
> > --- compiler/dead_proc_elim.m 2000/08/09 07:46:22 1.59
> > +++ compiler/dead_proc_elim.m 2000/09/19 05:37:45
> > @@ -790,6 +790,9 @@
> > % Don't eliminate preds from builtin.m or
> > % private_builtin.m, since polymorphism.m
> > % needs unify/2 and friends.
> > + % (Should the same apply for other builtin
> > + % modules, such as table_builtin?
> > + % I don't think so...)
> > mercury_public_builtin_module(PredModule)
> > ;
> > mercury_private_builtin_module(PredModule)
>
> This does need to check for predicates from table_builtin.m.
> Any predicates for which the compiler may introduce calls
> must be checked for here. This code is only run
> with --intermodule-optimization.
OK, fixed (diff below).
I also forgot to include my change to intermod.m in the diff
that I posted. I've enclosed that below.
I've committed this whole change now.
----------
compiler/intermod.m:
Add the builtin module dependencies.
This is needed in case a .opt file contains a tabling pragma.
Index: intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -u -r1.83 -r1.84
--- intermod.m 2000/09/08 12:20:34 1.83
+++ intermod.m 2000/09/21 00:23:49 1.84
@@ -2014,7 +2014,11 @@
% Figure out which .int files are needed by the .opt files
%
{ get_dependencies(OptItems, NewImportDeps0, NewUseDeps0) },
- { list__append(NewImportDeps0, NewUseDeps0, NewDeps0) },
+ globals__io_get_globals(Globals),
+ { get_implicit_dependencies(OptItems, Globals,
+ NewImplicitImportDeps0, NewImplicitUseDeps0) },
+ { NewDeps0 = list__condense([NewImportDeps0, NewUseDeps0,
+ NewImplicitImportDeps0, NewImplicitUseDeps0]) },
{ set__list_to_set(NewDeps0, NewDepsSet0) },
{ set__delete_list(NewDepsSet0, [ModuleName | OptFiles], NewDepsSet) },
{ set__to_sorted_list(NewDepsSet, NewDeps) },
----------
Estimated hours taken: 0.25
Fix an issue with my change to move the tabling builtins to a new module
that was identified in Simon Taylor's review comments.
compiler/dead_proc_elim.m:
Use any_mercury_builtin_module rather than just
testing for mercury_public_builtin_module and
mercury_private_builtin_module.
Workspace: /home/pgrad/fjh/ws/hg
Index: compiler/dead_proc_elim.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.60
diff -u -d -r1.60 dead_proc_elim.m
--- compiler/dead_proc_elim.m 2000/09/20 12:11:53 1.60
+++ compiler/dead_proc_elim.m 2000/09/20 12:14:26
@@ -787,15 +787,11 @@
% polymorphism.
code_util__compiler_generated(PredInfo)
;
- % Don't eliminate preds from builtin.m or
- % private_builtin.m, since polymorphism.m
- % needs unify/2 and friends.
- % (Should the same apply for other builtin
- % modules, such as table_builtin?
- % I don't think so...)
- mercury_public_builtin_module(PredModule)
- ;
- mercury_private_builtin_module(PredModule)
+ % Don't eliminate preds from builtin modules,
+ % since later passes of the compiler may introduce
+ % calls to them (e.g. polymorphism.m needs unify/2
+ % and friends).
+ any_mercury_builtin_module(PredModule)
;
% Don't attempt to eliminate local preds here, since we
% want to do semantic checking on those even if they
--
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