[m-rev.] for review: dead_pred_elim optimization

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Apr 1 18:46:27 AEST 2003


On 10-Mar-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> The new change is current bootchecking and will check it in when it
> succeeds.

I guess you didn't bootcheck it with --intermodule-optimization.

----------

Estimated hours taken: 1
Branches: main

compiler/hlds_module.m:
	Make sure that predicate_table_restrict preserves the order of the
	pred_id list.  This fix a bug introduced in Peter Ross's recent change,
	which broke a number of test cases in the Mercury test suite
	when intermodule optimization was enabled, e.g. because it caused
	some error messages to come out in reverse order.

Workspace: /home/ceres/fjh/mercury
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.82
diff -u -d -r1.82 hlds_module.m
--- compiler/hlds_module.m	15 Mar 2003 03:08:50 -0000	1.82
+++ compiler/hlds_module.m	1 Apr 2003 08:40:50 -0000
@@ -1778,7 +1778,13 @@
 		OrigPredicateTable, PredIds, PredicateTable) :-
 	predicate_table_reset(OrigPredicateTable, PredicateTable0),
 	predicate_table_get_preds(OrigPredicateTable, Preds),
-	PredicateTable = list__foldl(
+	% Note that we use foldr here rather than foldl,
+	% so that the PredIds list in the predicate table
+	% is the same as the PredIds list argument here
+	% (if we used foldl, it would get reversed, since each
+	% new predicate inserted into the table gets its pred_id
+	% added at the start of the list).
+	PredicateTable = list__foldr(
 			(func(PredId, Table0) = Table :-
 				PredInfo = map__lookup(Preds, PredId),
 				pred_info_get_markers(PredInfo, Markers),

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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