[m-rev.] Re: [m-dev.] deforestation optimization regression

Simon Taylor stayl at cs.mu.OZ.AU
Thu Feb 6 11:37:28 AEDT 2003


On 06-Feb-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> I just noticed that in 0.11 and the main branch, the deforestation
> optimization is not working properly -- for the test case that I just
> tried (see below), the Mercury compiler optimizes the two traversals into
> a single traversal, avoiding the unnecessary traversal of the intermediate
> data structure, but it fails to optimize away the *construction* of the
> intermediate data structure.  This problem appears to be a regression in
> Mercury release 0.11 -- it seems to work correctly in 0.10.

Estimated hours taken: 0.1
Branches: main, release

compiler/pd_util.m:
	Fix a problem reported by Fergus where deforestation
	was including unnecessary variables in the argument
	list of procedures created for deforested conjunctions.
	This was caused by the constraint propagation pass
	changing making the quantification information more
	conservative.

Index: pd_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/pd_util.m,v
retrieving revision 1.21
diff -u -u -r1.21 pd_util.m
--- pd_util.m	27 Jan 2003 09:20:49 -0000	1.21
+++ pd_util.m	5 Feb 2003 23:11:39 -0000
@@ -198,7 +198,12 @@
 				Globals, Simplifications) },
 			pd_util__simplify_goal(Simplifications, Goal4, Goal)
 		;
-			{ Goal = Goal1 }
+			% Use Goal0 rather than Goal1 because
+			% constraint propagation can make the
+			% quantification information more
+			% conservative even if it doesn't
+			% optimize anything.
+			{ Goal = Goal0 }
 		)
 	;
 		{ Goal = Goal0 }
--------------------------------------------------------------------------
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