[m-rev.] diff: fix order of fixup passes in inlining.m

Simon Taylor stayl at cs.mu.OZ.AU
Sat Aug 11 00:52:46 AEST 2001


Estimated hours taken: 0.25
Branches: main

compiler/inlining.m
	Requantify before recomputing instmap_deltas, not after.
	This shouldn't make any difference because the non-locals
	set for a goal can only shrink when quantification is rerun
	after inlining, and quantification.m will restrict the
	instmap_delta onto the reduced non-locals set.
	It may make a difference with alias tracking.
	Even if it doesn't, it's best to keep the order of
	these passes consistent throughout the compiler.

Index: inlining.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/inlining.m,v
retrieving revision 1.102
diff -u -u -r1.102 inlining.m
--- inlining.m	2001/07/20 14:13:32	1.102
+++ inlining.m	2001/08/07 08:21:40
@@ -461,22 +461,21 @@
 	proc_info_set_goal(ProcInfo3, Goal, ProcInfo4),
 
 	(
-		DidInlining = yes,
-		recompute_instmap_delta_proc(yes, ProcInfo4, ProcInfo5,
-			ModuleInfo0, ModuleInfo1)
+		Requantify = yes,
+		requantify_proc(ProcInfo4, ProcInfo5)
 	;
-		DidInlining = no,
-		ProcInfo5 = ProcInfo4,
-		ModuleInfo1 = ModuleInfo0
+		Requantify = no,
+		ProcInfo5 = ProcInfo4
 	),
 
-	globals__io_get_globals(Globals, IoState0, IoState),
 	(
-		Requantify = yes,
-		requantify_proc(ProcInfo5, ProcInfo)
+		DidInlining = yes,
+		recompute_instmap_delta_proc(yes, ProcInfo5, ProcInfo,
+			ModuleInfo0, ModuleInfo1)
 	;
-		Requantify = no,
-		ProcInfo = ProcInfo5
+		DidInlining = no,
+		ProcInfo = ProcInfo5,
+		ModuleInfo1 = ModuleInfo0
 	),
 
 	map__det_update(ProcTable0, ProcId, ProcInfo, ProcTable),
@@ -498,6 +497,7 @@
 		% then we re-run determinism analysis, because
 		% propagating the determinism information through
 		% the procedure may lead to more efficient code.
+	globals__io_get_globals(Globals, IoState0, IoState),
 	(
 		DetChanged = yes,	
 		det_infer_proc(PredId, ProcId, ModuleInfo2, ModuleInfo,
--------------------------------------------------------------------------
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