[m-dev.] diff: fix bug in RL stream detection

Simon Taylor stayl at cs.mu.OZ.AU
Tue Apr 18 15:06:27 AEST 2000


Estimated hours taken: 1

compiler/rl_stream.m:
	Make sure that the check of whether a relation is used
	more than once is applied to all relations variables used
	as inputs to some instruction, not just those which are
	aliased to other relation variables.


Index: rl_stream.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_stream.m,v
retrieving revision 1.5
diff -u -u -r1.5 rl_stream.m
--- rl_stream.m	2000/03/13 05:24:40	1.5
+++ rl_stream.m	2000/04/17 05:56:44
@@ -309,9 +309,12 @@
 	Info0 = stream_info(Materialise0, Uses, Aliases0),
 	relation__rtc(Aliases0, Aliases),
 	relation__domain(Aliases, AliasedRels0),
-	set__to_sorted_list(AliasedRels0, AliasedRels),
+	bag__to_assoc_list(Uses, UsesAL),
+	assoc_list__keys(UsesAL, UsedRels),
+	set__insert_list(AliasedRels0, UsedRels, RelsToCheck0),
+	set__to_sorted_list(RelsToCheck0, RelsToCheck),
 	list__foldl(rl_stream__end_block_check_relation(Uses, Aliases),
-		AliasedRels, Materialise0, Materialise),
+		RelsToCheck, Materialise0, Materialise),
 	Info = stream_info(Materialise, Uses, Aliases).
 
 	% Work out which relations used in this block need to be materialised.
--------------------------------------------------------------------------
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