diff: more progress messages.

Tyson Richard DOWD trd at cs.mu.oz.au
Fri May 16 15:33:45 AEST 1997


Hi,

	Can someone review this (rather insignificant) change?

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

Estimated hours taken: 0.2

Add some more very_verbose progress messages, move messages into
mercury_compile.m for uniformity. This makes it a little easier to
see whice stage map__lookups fail in.

compiler/mercury_compile.m:
	Write progress messages for computing liveness, allocating stack
	slots and live variable storage.
	Change the handling of detect_liveness_proc, since it no longer
	uses io__states.
	Rename some variables so the actions of llds_common are a little
	clearer.

compiler/liveness.m:
	Don't pass io__states to liveness - it only uses them to output
	a single progress message.
	Remove some commented out hlds_out__write_goal(..) calls.

Index: compiler/liveness.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/liveness.m,v
retrieving revision 1.72
diff -u -r1.72 liveness.m
--- liveness.m	1997/05/12 08:19:45	1.72
+++ liveness.m	1997/05/16 04:56:20
@@ -63,9 +63,8 @@
 	% This consists of the {pre,post}{birth,death} sets and
 	% resume point information.
 
-:- pred detect_liveness_proc(pred_id, proc_id, module_info,
-	proc_info, proc_info, io__state, io__state).
-:- mode detect_liveness_proc(in, in, in, in, out, di, uo) is det.
+:- pred detect_liveness_proc(proc_info, module_info, proc_info).
+:- mode detect_liveness_proc(in, in, out) is det.
 
 	% Return the set of variables live at the start of the procedure.
 
@@ -83,31 +82,25 @@
 :- import_module bool, list, map, set, std_util, term, assoc_list, require.
 :- import_module varset, string.
 
-detect_liveness_proc(PredId, ProcId, ModuleInfo, ProcInfo0, ProcInfo) -->
-	write_proc_progress_message("% Computing liveness in ", PredId, ProcId,
-		ModuleInfo),
-	{ proc_info_goal(ProcInfo0, Goal0) },
-	{ proc_info_variables(ProcInfo0, Varset) },
-	{ proc_info_vartypes(ProcInfo0, VarTypes) },
-	{ live_info_init(ModuleInfo, ProcInfo0, VarTypes, Varset, LiveInfo) },
-
-	{ initial_liveness(ProcInfo0, ModuleInfo, Liveness0) },
-	{ detect_liveness_in_goal(Goal0, Liveness0, LiveInfo,
-		_, Goal1) },
-
-	% hlds_out__write_goal(Goal1, ModuleInfo, Varset, 0, ""),
-
-	{ initial_deadness(ProcInfo0, ModuleInfo, Deadness0) },
-	{ detect_deadness_in_goal(Goal1, Deadness0, LiveInfo, _, Goal2) },
-
-	% hlds_out__write_goal(Goal2, ModuleInfo, Varset, 0, ""),
-
-	{ set__init(ResumeVars0) },
-	{ detect_resume_points_in_goal(Goal2, Liveness0, LiveInfo,
-		ResumeVars0, Goal, _) },
+detect_liveness_proc(ProcInfo0, ModuleInfo, ProcInfo) :-
+	proc_info_goal(ProcInfo0, Goal0),
+	proc_info_variables(ProcInfo0, Varset),
+	proc_info_vartypes(ProcInfo0, VarTypes),
+	live_info_init(ModuleInfo, ProcInfo0, VarTypes, Varset, LiveInfo),
+
+	initial_liveness(ProcInfo0, ModuleInfo, Liveness0),
+	detect_liveness_in_goal(Goal0, Liveness0, LiveInfo,
+		_, Goal1),
+
+	initial_deadness(ProcInfo0, ModuleInfo, Deadness0),
+	detect_deadness_in_goal(Goal1, Deadness0, LiveInfo, _, Goal2),
+
+	set__init(ResumeVars0),
+	detect_resume_points_in_goal(Goal2, Liveness0, LiveInfo,
+		ResumeVars0, Goal, _),
 
-	{ proc_info_set_goal(ProcInfo0, Goal, ProcInfo1) },
-	{ proc_info_set_liveness_info(ProcInfo1, Liveness0, ProcInfo) }.
+	proc_info_set_goal(ProcInfo0, Goal, ProcInfo1),
+	proc_info_set_liveness_info(ProcInfo1, Liveness0, ProcInfo).
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_compile.m,v
retrieving revision 1.34
diff -u -r1.34 mercury_compile.m
--- mercury_compile.m	1997/05/07 11:39:27	1.34
+++ mercury_compile.m	1997/05/16 05:15:44
@@ -787,9 +787,14 @@
 		{ ProcInfo3 = ProcInfo2 },
 		{ ModuleInfo3 = ModuleInfo2 }
 	),
-	detect_liveness_proc(PredId, ProcId, ModuleInfo3,
-		ProcInfo3, ProcInfo4),
+	write_proc_progress_message("% Computing liveness in ", PredId, ProcId,
+		ModuleInfo3),
+	{ detect_liveness_proc(ProcInfo3, ModuleInfo3, ProcInfo4) },
+	write_proc_progress_message("% Allocating stack slots in ", PredId,
+		                ProcId, ModuleInfo3),
 	{ allocate_stack_slots_in_proc(ProcInfo4, ModuleInfo3, ProcInfo5) },
+	write_proc_progress_message("% Allocating storage for live vars in ",
+				PredId, ProcId, ModuleInfo3),
 	{ store_alloc_in_proc(ProcInfo5, ModuleInfo3, ProcInfo6) },
 	{ module_info_get_shapes(ModuleInfo3, Shapes0) },
 	{ module_info_get_cell_count(ModuleInfo3, CellCount0) },
@@ -1306,7 +1311,7 @@
 mercury_compile__compute_liveness(HLDS0, Verbose, Stats, HLDS) -->
 	maybe_write_string(Verbose, "% Computing liveness...\n"),
 	maybe_flush_output(Verbose),
-	process_all_nonimported_procs(update_proc_io(detect_liveness_proc),
+	process_all_nonimported_procs(update_proc(detect_liveness_proc),
 		HLDS0, HLDS),
 	maybe_write_string(Verbose, "% done.\n"),
 	maybe_report_stats(Stats).
@@ -1377,12 +1382,13 @@
 	globals__io_lookup_bool_option(statistics, Stats),
 
 	{ base_type_info__generate_llds(HLDS0, BaseTypeInfos) },
-	{ base_type_layout__generate_llds(HLDS0, BaseTypeLayouts0) },
+	{ base_type_layout__generate_llds(HLDS0, BaseTypeLayouts) },
 
-	{ llds_common(LLDS0, BaseTypeLayouts0, ModuleName, LLDS1, 
-		BaseTypeLayouts, CommonData) },
-	{ list__append(BaseTypeInfos, BaseTypeLayouts, BaseTypeData) },
-	mercury_compile__chunk_llds(HLDS0, LLDS1, BaseTypeData, CommonData,
+	{ llds_common(LLDS0, BaseTypeLayouts, ModuleName, LLDS1, 
+		StaticData, CommonData) },
+
+	{ list__append(BaseTypeInfos, StaticData, AllData) },
+	mercury_compile__chunk_llds(HLDS0, LLDS1, AllData, CommonData,
 		LLDS2, NumChunks),
 	mercury_compile__output_llds(ModuleName, LLDS2, Verbose, Stats),
 
-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of
     trd at cs.mu.oz.au        #  fur.
http://www.cs.mu.oz.au/~trd #



More information about the developers mailing list