[m-dev.] [reuse] diff: call sr_choice
Peter Ross
petdr at miscrit.be
Tue Oct 10 23:04:16 AEDT 2000
Hi,
===================================================================
Estimated hours taken: 0.5
Integrate sr_choice into sr_direct.
sr_choice.m:
Rename sr_choice__apply_constraint_goal to sr_choice__process_goal.
sr_direct.m:
Call sr_choice.
Index: sr_choice.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_choice.m,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 sr_choice.m
--- sr_choice.m 2000/10/10 11:18:07 1.1.2.4
+++ sr_choice.m 2000/10/10 12:02:16
@@ -40,7 +40,7 @@
; random
.
-:- pred sr_choice__apply_constraint_goal(strategy::in, hlds_goal::in, hlds_goal::out,
+:- pred sr_choice__process_goal(strategy::in, hlds_goal::in, hlds_goal::out,
maybe(list(reuse_condition))::out) is det.
%-----------------------------------------------------------------------------%
@@ -51,7 +51,7 @@
:- import_module hlds_data, prog_data.
:- import_module multi_map, require, set.
-apply_constraint_goal(Strategy, Goal0, Goal, MaybeReuseConditions) :-
+process_goal(Strategy, Goal0, Goal, MaybeReuseConditions) :-
Strategy = strategy(Constraint, SelectionRule),
apply_constraint(Constraint, Goal0, Goal1),
select_reuses(SelectionRule, Goal1, Goal, ReuseConditions),
Index: sr_direct.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_direct.m,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 sr_direct.m
--- sr_direct.m 2000/10/09 19:12:21 1.1.2.3
+++ sr_direct.m 2000/10/10 12:02:17
@@ -35,29 +35,30 @@
:- import_module hlds_goal, hlds_data, prog_data.
process_proc(PredId, _ProcId, ProcInfo0, ProcInfo, ModuleInfo0, ModuleInfo) -->
- % Determine the LFU (local forward use)
+ % Determine the LFU (local forward use)
{ sr_lfu__process_proc(ProcInfo0, ProcInfo1) },
- % Determine the LBU (local backward use)
+ % Determine the LBU (local backward use)
{ sr_lbu__process_proc(ModuleInfo0, ProcInfo1, ProcInfo2) },
- % Determine which cells die and can be reused and what the
- % conditions on that reuse are
+ % Determine which cells die and can be reused and what
+ % the conditions on that reuse are
+ { proc_info_goal(ProcInfo2, Goal0) },
+ { pa_alias_as__init(Alias0) },
- { proc_info_goal( ProcInfo2, Goal0 ) },
- { pa_alias_as__init( Alias0 ) },
- % one needs the exact headvars for initializing the pool
+ % one needs the exact headvars for initializing the pool
{ compute_real_headvars(ModuleInfo0, PredId, ProcInfo0,
RealHeadVars) },
- { dead_cell_pool_init( RealHeadVars, Pool0 ) },
- { annotate_goal( ProcInfo2, ModuleInfo, Goal0, Goal,
- Pool0, _Pool, Alias0, _Alias ) },
- { proc_info_set_goal( ProcInfo2, Goal, ProcInfo3 ) },
+ { dead_cell_pool_init(RealHeadVars, Pool0) },
+ { annotate_goal(ProcInfo2, ModuleInfo, Goal0, Goal1,
+ Pool0, _Pool, Alias0, _Alias) },
- % Select which cells will be reused and which can be compile
- % time garbage collected.
+ % Select which cells will be reused and which can be
+ % compile time garbage collected.
+ { sr_choice__process_goal(strategy(same_cons_id, random),
+ Goal1, Goal, _MaybeReuseConditions) },
- { ProcInfo = ProcInfo3 },
+ { proc_info_set_goal( ProcInfo2, Goal, ProcInfo ) },
{ ModuleInfo = ModuleInfo0 }.
:- pred compute_real_headvars(module_info, pred_id, proc_info,
--------------------------------------------------------------------------
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