[m-dev.] [reuse] diff: bugfix again vanishing reuse conditions

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Mon Oct 16 20:05:26 AEDT 2000


Hi,


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


Estimated hours taken: 2

Again some conditions mysteriously vanished. This time it was again
caused by the reuse_condition update operation: conditions which were
alread expressed in terms of the correct headvars disappeared. The
reason for this is that the nodes themselves where not considered, 
only the nodes aliased to them. 

sr_data.m:
	The actual bugfix: Do not only consider the aliases of the
	reused nodes when updating the reuse_conditions, but also
	consider the nodes themselves. 

pa_alias_as.m:
	Turn the optimization for constructions back on. 

Index: pa_alias_as.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/pa_alias_as.m,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 pa_alias_as.m
--- pa_alias_as.m	2000/10/15 17:50:14	1.1.2.3
+++ pa_alias_as.m	2000/10/16 08:56:57
@@ -396,23 +396,25 @@
 extend_unification( ProcInfo, HLDS, Unif, GoalInfo, ASin, ASout ):-
 	pa_alias__from_unification( ProcInfo, HLDS, Unif, GoalInfo, AUnif),
 	wrap(AUnif, ASUnif),
-	extend( ProcInfo, HLDS, ASUnif, ASin, ASout). 
-/*
+%	extend( ProcInfo, HLDS, ASUnif, ASin, ASout). 
 	extend( ProcInfo, HLDS, ASUnif, ASin, ASout0), 
 	(
 		Unif = construct(_, _, _, _, _, _, _)
 	-> 
-		optimization_remove_deaths( ASout0, GoalInfo, ASout)
+		optimization_remove_deaths( ProcInfo, ASout0, GoalInfo, ASout)
 	;
 		ASout = ASout0
 	).
-*/
 
-:- pred optimization_remove_deaths( alias_as, hlds_goal_info, alias_as).
-:- mode optimization_remove_deaths( in, in, out) is det.
+:- pred optimization_remove_deaths( proc_info, alias_as, 
+					hlds_goal_info, alias_as).
+:- mode optimization_remove_deaths( in, in, in, out) is det.
 
-optimization_remove_deaths( ASin, GI, ASout ) :-
-	hlds_goal__goal_info_get_post_deaths( GI, Deaths),
+optimization_remove_deaths( ProcInfo, ASin, GI, ASout ) :-
+	proc_info_headvars( ProcInfo, HeadVars ), 
+	set__list_to_set( HeadVars, HeadVarsSet), 
+	hlds_goal__goal_info_get_post_deaths( GI, Deaths0),
+	set__difference( Deaths0, HeadVarsSet, Deaths), 
 	set__to_sorted_list( Deaths, DeathsList),
 	(
 		ASin = real_as( Aliases0)
Index: sr_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_data.m,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 sr_data.m
--- sr_data.m	2000/10/15 11:26:16	1.1.2.8
+++ sr_data.m	2000/10/16 08:56:58
@@ -293,7 +293,7 @@
 		OLD_NODES,
 		LISTS_ALL_NEW_NODES
 		),
-	list__condense(LISTS_ALL_NEW_NODES, ALL_NEW_NODES),
+	list__condense( [ OLD_NODES | LISTS_ALL_NEW_NODES], ALL_NEW_NODES),
 	list__filter(
 		pred(DATA::in) is semidet :-
 		  ( pa_datastruct__get_var(DATA,V), 
Index: sr_indirect.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_indirect.m,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 sr_indirect.m
--- sr_indirect.m	2000/10/15 17:28:00	1.1.2.4
+++ sr_indirect.m	2000/10/16 08:56:58
@@ -185,7 +185,7 @@
 					LengthS, "\n"], Msg2) } ,
 			maybe_write_string(VeryVerbose, Msg2)
 		; 
-			maybe_write_string(VeryVerbose, "%\t No reuse.\n")
+			maybe_write_string(VeryVerbose, "%\tNo reuse.\n")
 		)
 	),
 	{ 
--------------------------------------------------------------------------
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