[m-rev.] [reuse] for review: move type definitions to prog_data

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Thu Jun 10 16:12:58 AEST 2004


Hi,

for Zoltan to review. 

This is my plan for further adapting and improving the module dependencies of
the alias and reuse modules: 

1. move the type definitions (as you suggested) for selector to prog_data.  I
also moved "datastruct", "alias" (= pair of datastructs) to prog_data, and
added the new types aliases (list of alias) and "reuse_tuple". While "aliases"
is meant to give a public representation of the type alias_as (module
pa_alias_as), "reuse_tuple" is the public representation for "reuse_condition"
(module sr_data). 
As selector depends on "cons_id", I've temporarely added the module dependency
hlds_data. If I remember well you were saying that you planned to move
"cons_id" to prog_data anyhow. So this wouldn't be a problem in the end...

2. in the HLDS I will store only aliases and reuse conditions in their
public form... so the dependencies to "pa_alias_as", "sr_data" or alike will
disappear. 

3. I don't want to constantly having to convert between the public
representations for aliases/reuse conditions and their private representations.
This means I will use a separate alias-map during alias-analysis (and only
store the results in the HLDS when the alias-analysis is finished), and idem,
a separate reuse-conditions-map during reuse-analysis. As reuse analysis relies
on the results of alias analysis, I will simply pass the resulting alias-map to
the reuse-pass in the form of a simple extra argument. 

4. instead of annotating goal-infos during reuse analysis with temporary reuse
information, I will again use a separate map relating program points (as you
suggested, these can be identified by their unique goal-paths), and the
possible reuses that can be done at these program points. This means that the
reuse field within "hlds_goal_reuse_info" is not needed anymore, and only the
results of the analysis need to be incorporated at the relevant program points.

5. finally, the parsing. Given the public types, the parsing can be completely
performed within prog_io_pragma (instead of referring to
pa_alias_as__parse_read_aliases, or sr_data__memo_reuse_parse).


Below is the diff for step 1. 

Probably this is exactly what you were trying to tell me? ;-) So does this
scheme seem right to you? 
Nancy

PS: obviously, the type "aliasing" defined in prog_data can then be expressed
in terms of the public type "aliases", hence not relying on alias_as (not in
the diff below)

===================================================================


Estimated hours taken: 2
Branches: reuse

Move the type-definitions for selector, datastruct, and alias to prog_data. 
Add the types aliases (list of alias'es), and reuse_tuple (the 'public'
counterpart for reuse_condition) as well. 

prog_data.m:
	Move the type-definitions. 
	Add the types "aliases" and "reuse_tuple". 

hlds_pred.m:
pa_alias.m:
pa_alias_as.m:
pa_alias_set.m:
pa_datastruct.m:
pa_selector.m:
sr_data.m:
sr_indirect.m:
sr_live.m:
	Changes due to the move of the type-definitions. 

sr_data.m:
	Added an XXX comment where there seems a bug. I.e. reuse_condition is
	now defined in terms of the headvariables that are in use at the
	reuse-point, while the in use information should be extended w.r.t. 
	the local aliases and then projected on the head variables. Clearly to
	be checked. 

Index: hlds_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.81.2.22
diff -u -r1.81.2.22 hlds_pred.m
--- hlds_pred.m	2 Jun 2004 10:30:38 -0000	1.81.2.22
+++ hlds_pred.m	10 Jun 2004 05:23:09 -0000
@@ -23,7 +23,7 @@
 :- import_module bool, list, set, map, std_util, term, varset.
 :- import_module possible_alias.
 :- import_module possible_alias__pa_alias_as.
-:- import_module possible_alias__pa_datastruct.
+% :- import_module possible_alias__pa_datastruct.
 :- import_module structure_reuse.
 :- import_module structure_reuse__sr_data.
 
@@ -1812,11 +1812,11 @@
 :- mode proc_info_set_reuse_information(in, in, out) is det.
 
 :- pred proc_info_static_terms(proc_info, 
-		maybe(set(pa_datastruct__datastruct))).
+		maybe(set(prog_data__datastruct))).
 :- mode proc_info_static_terms(in, out) is det.
 
 :- pred proc_info_set_static_terms(proc_info, 
-		maybe(set(pa_datastruct__datastruct)), proc_info).
+		maybe(set(prog_data__datastruct)), proc_info).
 :- mode proc_info_set_static_terms(in, in, out) is det.
 
 :- pred proc_info_get_need_maxfr_slot(proc_info, bool).
@@ -2118,7 +2118,7 @@
 					% Possible set of datastructures that
 					% might be static after calling
 					% the procedure. 
-			static_terms:: maybe(set(pa_datastruct__datastruct))
+			static_terms:: maybe(set(prog_data__datastruct))
 	).
 
 :- func pa_sr_info_init = pa_sr_info. 
Index: pa_alias.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_alias.m,v
retrieving revision 1.1.2.18
diff -u -r1.1.2.18 pa_alias.m
--- pa_alias.m	8 Jun 2004 05:13:52 -0000	1.1.2.18
+++ pa_alias.m	10 Jun 2004 05:23:10 -0000
@@ -17,17 +17,16 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module parse_tree__prog_data.
-:- import_module possible_alias__pa_datastruct.
 :- import_module structure_reuse__sr_live. % XXX should be removed, eventually.
 
-:- import_module set, list, std_util.
+:- import_module set, list.
 :- import_module io, string, term.
 
 %-------------------------------------------------------------------%
 %-- exported types
 
 % :- type alias.
-:- type alias == pair(datastruct).
+% :- type alias == pair(datastruct).
 
 %-------------------------------------------------------------------%
 %-- exported predicates
@@ -66,7 +65,7 @@
 :- import_module possible_alias__pa_selector.
 :- import_module possible_alias__pa_sr_util.
 
-:- import_module varset, require, int, map.
+:- import_module varset, require, int, map, std_util.
 
 %-------------------------------------------------------------------%
 % printing routines
@@ -133,8 +132,8 @@
 
 contains_one_of_vars(Set, Alias, DATA) :- 
 	Alias = Data1 - Data2,
-	Var1 = Data1^var,
-	Var2 = Data2^var,
+	Var1 = Data1^dsvar,
+	Var2 = Data2^dsvar,
 	(
 		set__member(Var1, Set)
 	->
@@ -435,8 +434,8 @@
 	% 	   or
 	%		sy.s2 = s1 => sx1 = sx.s2
 :- pred one_of_vars_is_live(module_info::in, proc_info::in, 
-		list(pa_datastruct__datastruct)::in, alias::in, 
-		list(pa_datastruct__datastruct)::out) is det.
+		list(prog_data__datastruct)::in, alias::in, 
+		list(prog_data__datastruct)::out) is det.
 one_of_vars_is_live(ModuleInfo, ProcInfo, Datastructs0, 
 		Alias0, Datastructs) :- 
 	one_of_vars_is_live_ordered(ModuleInfo, ProcInfo, 
@@ -447,8 +446,8 @@
 	list__append(L1,L2, Datastructs).
 
 :- pred one_of_vars_is_live_ordered(module_info::in, proc_info::in,
-		list(pa_datastruct__datastruct)::in, alias::in,
-		list(pa_datastruct__datastruct)::out) is det.
+		list(prog_data__datastruct)::in, alias::in,
+		list(prog_data__datastruct)::out) is det.
 one_of_vars_is_live_ordered(ModuleInfo, ProcInfo, List, ALIAS, List_Xsx1) :- 
 	ALIAS = Xsx - Ysy,
 	list__filter(same_vars(Ysy), List, Y_List),
Index: pa_alias_as.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_alias_as.m,v
retrieving revision 1.1.2.33
diff -u -r1.1.2.33 pa_alias_as.m
--- pa_alias_as.m	8 Jun 2004 05:13:52 -0000	1.1.2.33
+++ pa_alias_as.m	10 Jun 2004 05:23:12 -0000
@@ -69,8 +69,8 @@
 	% The operation produces a software error when called with
 	% a top alias description. 
 :- pred collect_aliases_of_datastruct(module_info::in, proc_info::in, 
-		pa_datastruct__datastruct::in, alias_as::in, 
-		list(pa_datastruct__datastruct)::out) is det.
+		prog_data__datastruct::in, alias_as::in, 
+		list(prog_data__datastruct)::out) is det.
 
 	% If AliasIn is the exit description stored for a particular
 	% procedure definition (identified by its pred_proc_id, Id), then
@@ -991,7 +991,7 @@
 	).
 
 
-:- pred parse_list_alias_term(term(T), list(pa_alias__alias)).
+:- pred parse_list_alias_term(term(T), list(prog_data__alias)).
 :- mode parse_list_alias_term(in, out) is det.
 
 parse_list_alias_term(TERM, Aliases) :-
@@ -1104,7 +1104,7 @@
 
 :- pred parse_user_datastruct(term::in, 
-		pa_datastruct__datastruct::out) is det. 
+		prog_data__datastruct::out) is det. 
 parse_user_datastruct(Term, Data):- 
 	(
 		Term = term__functor(term__atom("cel"),
@@ -1288,7 +1288,7 @@
 	% live_2(IN_USE, Aliases, Liveset)
 	% pre-condition: IN_USE is not empty
 :- pred live_2(module_info, proc_info, set(prog_var),sr_live__live_set,
-		list(pa_alias__alias), sr_live__live_set).
+		list(prog_data__alias), sr_live__live_set).
 :- mode live_2(in, in, in, in, in, out) is det.
 
 live_2(ModuleInfo, ProcInfo, IN_USE, LIVE_0, ALIASES, LIVE) :- 
Index: pa_alias_set.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_alias_set.m,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 pa_alias_set.m
--- pa_alias_set.m	8 Jun 2004 05:13:52 -0000	1.1.2.11
+++ pa_alias_set.m	10 Jun 2004 05:23:15 -0000
@@ -19,8 +19,6 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module parse_tree__prog_data. 
-:- import_module possible_alias__pa_alias.
-:- import_module possible_alias__pa_datastruct. 
 
 :- import_module list, set, map, io, term, bool.
 
@@ -46,8 +44,8 @@
 	% Compute all the datastructures that point to the same memory space
 	% occupied by a given data structure. 
 :- pred collect_aliases_of_datastruct(module_info::in, proc_info::in, 
-		pa_datastruct__datastruct::in, alias_set::in,
-		list(pa_datastruct__datastruct)::out) is det.
+		prog_data__datastruct::in, alias_set::in,
+		list(prog_data__datastruct)::out) is det.
 
 	% Rename the prog_vars occurring in the alias_set, using
 	% a map that maps the to-be-replaced-vars with on the
@@ -132,7 +130,9 @@
 
 :- implementation.
 
+:- import_module possible_alias__pa_alias.
 :- import_module possible_alias__pa_selector.
+:- import_module possible_alias__pa_datastruct. 
 
 :- import_module std_util.
 :- import_module int, bool, assoc_list. 
@@ -250,8 +250,8 @@
 				alias_set::in, alias_set::out) is det.
 new_directed_entry(FromData, ToData, AliasSet0, AliasSet):- 
 	AliasSet0 = alias_set(Size0, Map0), 
-	get_var(FromData, Var), 
-	get_selector(FromData, Selector), 
+	Var = FromData^dsvar, 
+	Selector = FromData^dsselector, 
 	(
 		map__search(Map0, Var, Selectors0)
 	->
@@ -292,7 +292,7 @@
 				pred(SelData::in, Alias::out) is semidet:- 
 				    (
 					SelData = Selector - Datastruct, 
-					term__var_to_int(Datastruct^var,
+					term__var_to_int(Datastruct^dsvar,
 						DataVarInt),
 					DataVarInt =< VarInt, 
 					pa_datastruct__init(Var, 
@@ -354,10 +354,9 @@
 collect_aliases_of_datastruct(ModuleInfo, ProcInfo, Datastruct, 
 			AliasSet, Datastructs):- 
 	AliasSet = alias_set(_Size, Map), 
-	get_var(Datastruct, Var), 
+	Datastruct = cel(Var, Selector), 
 	proc_info_vartypes(ProcInfo, VarTypes), 
 	map__lookup(VarTypes, Var, VarType), 
-	get_selector(Datastruct, Selector),
 	(
 		map__search(Map, Var, SelectorSet)
 	->
@@ -1077,7 +1076,7 @@
 			pa_datastruct__init(ProgVar, Sel0, Data0), 
 			pa_datastruct__apply_widening(ModuleInfo, 
 				ProcInfo, Data0, Data), 
-			Sel = Data^selector,
+			Sel = Data^dsselector,
 
 			% regroup the widened dataset with the dataset
 			% that is associated with the widened Sel, as this
@@ -1169,7 +1168,7 @@
 	data_set_filter(
 		pred(Data::in) is semidet :- 
 		(
-			get_var(Data, Var), 
+			Var = Data^dsvar,
 			list__member(Var, Vars)
 		),
 		DataSet0, 
@@ -1256,7 +1255,7 @@
 	data_set_filter(
 		pred(DataStruct::in) is semidet :- 
 		(
-			get_var(DataStruct, Var), 
+			Var = DataStruct^dsvar,
 			\+ list__member(Var, Vars)
 		), 
 		DataSet0, 
Index: pa_datastruct.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_datastruct.m,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 pa_datastruct.m
--- pa_datastruct.m	8 Jun 2004 05:13:53 -0000	1.1.2.11
+++ pa_datastruct.m	10 Jun 2004 05:23:15 -0000
@@ -25,14 +25,14 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module parse_tree__prog_data.
-:- import_module possible_alias__pa_selector.
 
 :- import_module map, io, term.
 
 %-------------------------------------------------------------------%
 %-- exported types
 
-:- type datastruct.
+% Type-definition has become public and is moved to prog_data.
+% :- type datastruct.
 
 %-------------------------------------------------------------------%
 %-- exported predicates
@@ -54,12 +54,6 @@
 	% identified by the constructor and index within that constructor. 
 :- pred init(prog_var::in, cons_id::in, int::in, datastruct::out) is det.
 
-:- pred get_var(datastruct::in, prog_var::out) is det.
-:- func var(datastruct) = prog_var. 
-
-:- pred get_selector(datastruct::in, selector::out) is det.
-:- func selector(datastruct) = selector. 
-
 	% Extend the given datastructure with an additional path.
 :- pred termshift(datastruct::in, selector::in, datastruct::out) is det. 
 
@@ -110,15 +104,16 @@
 :- implementation.
 
 :- import_module check_hlds__type_util.
+:- import_module possible_alias__pa_selector.
 
 :- import_module string, varset, require, list.
 
-:- type datastruct ---> cel(prog_var, pa_selector__selector).
+% :- type datastruct ---> cel(prog_var, pa_selector__selector).
 
-get_var(cel(Var, _Sel), Var).
-var(cel(Var, _Sel)) = Var. 
-get_selector(cel(_Var, Sel), Sel).
-selector(cel(_Var, Sel)) = Sel.
+% get_var(cel(Var, _Sel), Var).
+% var(cel(Var, _Sel)) = Var. 
+% get_selector(cel(_Var, Sel), Sel).
+% selector(cel(_Var, Sel)) = Sel.
 
 
 rename(MAP, DATAin, DATAout) :-
@@ -133,22 +128,20 @@
 
 equal(D1, D2):- D1 = D2.
 
-same_vars(D1, D2):-
-	get_var(D1,V),
-	get_var(D2,V).
+same_vars(D1, D2):- 
+	D1^dsvar = D2^dsvar.
 
 less_or_equal(ModuleInfo, ProcInfo, D1,D2, EXT):-
 	same_vars(D1,D2),
-	get_var(D1,ProgVar), 
 	proc_info_vartypes(ProcInfo, VarTypes), 
-	map__lookup(VarTypes, ProgVar, ProgVarType), 
+	map__lookup(VarTypes, D1^dsvar, ProgVarType), 
 	(
 		equal(D1,D2)
 	->
 		pa_selector__init(EXT)
 	;
-		get_selector(D1,S1),
-		get_selector(D2,S2),
+		S1 = D1^dsselector, 
+		S2 = D2^dsselector, 
 		pa_selector__less_or_equal(ModuleInfo,S1,S2,ProgVarType,EXT)
 	).
 
Index: pa_selector.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_selector.m,v
retrieving revision 1.1.2.15
diff -u -r1.1.2.15 pa_selector.m
--- pa_selector.m	8 Jun 2004 05:13:54 -0000	1.1.2.15
+++ pa_selector.m	10 Jun 2004 05:23:16 -0000
@@ -23,10 +23,11 @@
 %-------------------------------------------------------------------%
 %-- exported types
 
-:- type selector == list(unit_sel).
-:- type unit_sel ---> 
-		us(hlds_data__cons_id, int) ;  % normal selector
-		ts(prog_data__type).		 % type selector
+% Moved to prog_data.m
+% :- type selector == list(unit_sel).
+% :- type unit_sel ---> 
+%		us(hlds_data__cons_id, int) ;  % normal selector
+%		ts(prog_data__type).		 % type selector
 			
 
 %-------------------------------------------------------------------%
Index: prog_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_data.m,v
retrieving revision 1.58.2.16
diff -u -r1.58.2.16 prog_data.m
--- prog_data.m	2 Jun 2004 10:30:50 -0000	1.58.2.16
+++ prog_data.m	10 Jun 2004 05:23:23 -0000
@@ -22,6 +22,10 @@
 % Any types which are needed in both the parse tree and in the HLDS
 % should be defined here, rather than in hlds*.m.
 
+	% XXX temporary. Type "cons_id" needed for selector.
+:- import_module hlds.
+:- import_module hlds__hlds_data.
+
 :- import_module (parse_tree__inst), libs__options, libs__globals.
 :- import_module recompilation.
 :- import_module bool, list, assoc_list, map, set, varset, term, std_util.
@@ -429,6 +433,28 @@
 				% possible inputs.
 	;	can_loop.	% This procedure might not terminate.
 
+%
+% Stuff for the 'pa_alias_info' and 'sr_reuse_info' pragma's.
+% 
+
+:- type selector == list(unit_sel).
+:- type unit_sel 
+	---> 	us(hlds_data__cons_id, int) ;  % normal selector
+		ts(prog_data__type).		 % type selector
+:- type datastruct 
+	---> 	cel(
+			dsvar::		prog_var, 
+			dsselector:: 	selector
+		).
+:- type alias == pair(datastruct).
+:- type aliases == list(alias).
+:- type reuse_tuple
+	---> 	unconditional
+	; 	conditional(
+		    reuse_nodes		:: set(datastruct),
+		    live_headvars	:: set(datastruct), 
+		    alias_headvars	:: aliases
+		).
 
 %
 % Stuff for the `unused_args' pragma.
Index: sr_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_data.m,v
retrieving revision 1.1.2.24
diff -u -r1.1.2.24 sr_data.m
--- sr_data.m	8 Jun 2004 05:13:54 -0000	1.1.2.24
+++ sr_data.m	10 Jun 2004 05:23:50 -0000
@@ -20,7 +20,6 @@
 :- import_module hlds__hlds_pred.
 :- import_module parse_tree__prog_data.
 :- import_module possible_alias__pa_alias_as.
-:- import_module possible_alias__pa_datastruct.
 :- import_module structure_reuse__sr_live.
 
 :- import_module bool, map, set, std_util, list, io, term.
@@ -94,7 +93,7 @@
 :- type reuse_condition
 	--->	always
 	;	condition(
-		   nodes 		:: set(pa_datastruct__datastruct),
+		   nodes 		:: set(prog_data__datastruct),
 		   local_use_headvars 	:: set(prog_var),
 		   local_alias_headvars :: alias_as 
 		).
@@ -279,7 +278,7 @@
 			ALIASi, AliasedData),
 		list__filter(
 			pred(Data::in) is semidet :-
-			  (list__member(Data^var, HVs)),
+			  (list__member(Data^dsvar, HVs)),
 			AliasedData,
 			Nodes)
 	),
@@ -290,6 +289,11 @@
 	;
 		set__union(LFUi, LBUi, LUi),
 		set__list_to_set(HVs, HVsSet),
+			% XXX This is not what the theory sais. LUi should be
+			% extended w.r.t. the local aliases, and the resulting
+			% set of datastructures projected on the set of
+			% headvariables. 
+			% XXX Thus: WRONG here!!
 		set__intersect(LUi, HVsSet, LUiHVs),
 		pa_alias_as__project(HVs, ALIASi, LAiHVs),
 		set__list_to_set(Nodes, Nodes_set),
@@ -373,7 +377,7 @@
 		% constructed.
 	list__filter_map(
 		(pred(Node::in, Var::out) is semidet :-
-			get_var(Node, Var),
+			Var = Node^dsvar,
 			set__member(Var, Static)
 		), set__to_sorted_list(Nodes), []),
 	
@@ -403,7 +407,7 @@
 	list__condense([ OLD_NODES | LISTS_ALL_NEW_NODES], ALL_NEW_NODES),
 	list__filter(
 		pred(DATA::in) is semidet :-
-		  (list__member(DATA^var, HVs)),
+		  (list__member(DATA^dsvar, HVs)),
 		ALL_NEW_NODES,
 		NEW_NODES),
 	(
@@ -440,13 +444,13 @@
 	% Collect the nodes a reuse-condition is talking about. Fail 
 	% if the reuse condition is `always'. 
 :- pred reuse_condition_get_nodes(reuse_condition::in, 
-			set(pa_datastruct__datastruct)::out) is semidet.
+			set(prog_data__datastruct)::out) is semidet.
 reuse_condition_get_nodes(Condition, Condition ^ nodes). 
 
 	% Collect the nodes a reuse-condition is talking about. Fail 
 	% if the reuse condition is `always'. 
 :- pred reuse_condition_get_nodes_list(reuse_condition::in, 
-			list(pa_datastruct__datastruct)::out) is semidet.
+			list(prog_data__datastruct)::out) is semidet.
 reuse_condition_get_nodes_list(Condition, List):-
 	set__to_sorted_list(Condition ^ nodes, List). 
 
@@ -650,7 +654,7 @@
 		error("(sr_data) condition_parse: term is not a functor")
 	).
 
-:- pred nodes_parse(term(T)::in, list(pa_datastruct__datastruct)::out) is det.
+:- pred nodes_parse(term(T)::in, list(prog_data__datastruct)::out) is det.
 
 nodes_parse(Term, Datastructs) :- 
 	(
@@ -777,8 +781,8 @@
 	).
 
 :- pred no_aliases_between_reuse_nodes_2(module_info::in, proc_info::in,
-		pa_datastruct__datastruct::in, 
-		list(pa_datastruct__datastruct)::in, 
+		prog_data__datastruct::in, 
+		list(prog_data__datastruct)::in, 
 		alias_as::in) is semidet. 
 no_aliases_between_reuse_nodes_2(ModuleInfo, ProcInfo, Node, OtherNodes, 
 		Alias):- 
@@ -805,8 +809,8 @@
 	% Data): This procedure succeeds if Data is subsumed or subsumes
 	% some of the datastructures in Datastructs. 
 :- pred there_is_a_subsumption_relation(module_info::in, proc_info::in, 
-		list(pa_datastruct__datastruct)::in, 
-		pa_datastruct__datastruct::in) is semidet.
+		list(prog_data__datastruct)::in, 
+		prog_data__datastruct::in) is semidet.
 there_is_a_subsumption_relation(ModuleInfo, ProcInfo, 
 		Datastructs0, Data0):-
 	list__filter(
Index: sr_indirect.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_indirect.m,v
retrieving revision 1.1.2.31
diff -u -r1.1.2.31 sr_indirect.m
--- sr_indirect.m	7 Jun 2004 08:14:53 -0000	1.1.2.31
+++ sr_indirect.m	10 Jun 2004 05:23:52 -0000
@@ -655,7 +655,7 @@
 		% check whether reason for no reuse is StaticVars
 		list__filter_map(
 			(pred(Node::in, Var::out) is semidet :- 
-				get_var(Node, Var),
+				Var = Node^dsvar, 
 				set__member(Var, StaticVars)
 			), 
 			NodesL, 
Index: sr_live.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_live.m,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 sr_live.m
--- sr_live.m	8 Jun 2004 05:13:54 -0000	1.1.2.6
+++ sr_live.m	10 Jun 2004 05:23:53 -0000
@@ -16,7 +16,6 @@
 :- import_module hlds__hlds_module. 
 :- import_module hlds__hlds_pred.
 :- import_module parse_tree__prog_data.
-:- import_module possible_alias__pa_datastruct.
 
 :- import_module set.
 :- import_module list.
@@ -35,7 +34,7 @@
 :- pred init(set(prog_var),live_set).
 :- mode init(in,out) is det.
 
-:- pred from_datastructs(list(pa_datastruct__datastruct), live_set).
+:- pred from_datastructs(list(prog_data__datastruct), live_set).
 :- mode from_datastructs(in, out) is det.
 
 :- pred bottom(live_set).
@@ -46,7 +45,7 @@
 :- mode top(out) is det.
 :- mode top(in) is semidet.
 
-:- pred get_datastructs(live_set, list(pa_datastruct__datastruct)).
+:- pred get_datastructs(live_set, list(prog_data__datastruct)).
 :- mode get_datastructs(in, out) is det.
 
 :- pred union(list(live_set), live_set).
@@ -56,7 +55,7 @@
 :- mode is_live(in, in) is semidet.
 
 :- pred is_live_datastruct(module_info, proc_info, 
-			pa_datastruct__datastruct, live_set).
+			prog_data__datastruct, live_set).
 :- mode is_live_datastruct(in, in, in, in) is semidet.
 
 :- pred project(list(prog_var), live_set, live_set).
@@ -67,6 +66,7 @@
 :- implementation.
 
 :- import_module require.
+:- import_module possible_alias__pa_datastruct.
 
 %-------------------------------------------------------------------%
 %-- additional types 
@@ -74,7 +74,7 @@
 :- type live_set ---> 
 			bottom
 		; 	top
-		; 	live(list(pa_datastruct__datastruct)).
+		; 	live(list(prog_data__datastruct)).
 
 
 %-------------------------------------------------------------------%
@@ -92,7 +92,7 @@
 	% check whether minimal !! 
 	live_wrap(DATASTRUCTS, LIVE).
 
-:- func func_datastruct_init(prog_var) =  pa_datastruct__datastruct.
+:- func func_datastruct_init(prog_var) =  prog_data__datastruct.
 :- mode func_datastruct_init(in) = out is det.
 
 func_datastruct_init(VAR) = DATA :-
@@ -103,7 +103,7 @@
 bottom(bottom).
 top(top).
 
-:- pred live_wrap(list(pa_datastruct__datastruct), live_set).
+:- pred live_wrap(list(prog_data__datastruct), live_set).
 :- mode live_wrap(in,out) is det.
 
 live_wrap(List, Live):-
@@ -203,7 +203,7 @@
 		list__filter(
 			pred(D::in) is semidet :- 
 			    (
-				list__member(D^var, VARS)
+				list__member(D^dsvar, VARS)
 			    ),
 			Datastructs, 
 			FilteredDatastructs),


-- 
nancy.mazur at cs.kuleuven.ac.be ------------ Katholieke Universiteit Leuven -
tel: +32-16-327596 - fax: +32-16-327996 ------- Dept. of Computer Science -
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list