[m-dev.] for review: clip instmap deltas to typeinfo completed nonlocals

Zoltan Somogyi zs at cs.mu.OZ.AU
Sun Aug 6 21:42:16 AEST 2000


On 06-Aug-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> This change seems to have broken debug grades completely.

On 06-Aug-2000, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> The change I committed about factoring out common and should-have-been-common
> code in unify_proc.m should fix this bug. (The bug was the code that should
> have been common but wasn't.)

Actually, that was not the whole problem. The following diff was also needed:

compiler/mode_info.m:
compiler/liveness.m:
	When modechecking or computing livenesses for predicates from the
	builtin modules, do not switch on typeinfo liveness. Predicates from
	those two modules never have typeinfo liveness applied to them,
	since such predicates may not have the required typeinfos.

Actually, this is just two new instances of a problem that I have fixed in
several other places in the new code generator change. These places weren't
fixed together with the others because they did not exist at the time.

Later I will make available a cleaner fix, which redesigns the interface of
body_should_use_typeinfo_liveness.

Zoltan.

cvs diff: Diffing .
Index: liveness.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/liveness.m,v
retrieving revision 1.105
diff -u -b -r1.105 liveness.m
--- liveness.m	2000/08/03 08:46:22	1.105
+++ liveness.m	2000/08/06 07:54:29
@@ -145,7 +145,7 @@
 
 :- import_module hlds_goal, hlds_data, llds, quantification, (inst), instmap.
 :- import_module hlds_out, mode_util, code_util, quantification, options.
-:- import_module trace, globals, polymorphism, passes_aux.
+:- import_module trace, globals, polymorphism, passes_aux, prog_util.
 :- import_module term, varset.
 
 :- import_module bool, map, std_util, list, assoc_list, require.
@@ -154,7 +154,17 @@
 detect_liveness_proc(ProcInfo0, PredId, ModuleInfo, ProcInfo) :-
 	module_info_globals(ModuleInfo, Globals),
 	body_should_use_typeinfo_liveness(Globals, TypeInfoLiveness0),
-	requantify_proc(TypeInfoLiveness0, ProcInfo0, ProcInfo1),
+	(
+		pred_info_module(PredInfo, PredModule),
+		( mercury_public_builtin_module(PredModule)
+		; mercury_private_builtin_module(PredModule)
+		)
+	->
+		TypeInfoLiveness1 = no
+	;
+		TypeInfoLiveness1 = TypeInfoLiveness0
+	),
+	requantify_proc(TypeInfoLiveness1, ProcInfo0, ProcInfo1),
 
 	proc_info_goal(ProcInfo1, Goal0),
 	proc_info_varset(ProcInfo1, Varset),
Index: mode_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_info.m,v
retrieving revision 1.53
diff -u -b -r1.53 mode_info.m
--- mode_info.m	2000/08/03 08:46:28	1.53
+++ mode_info.m	2000/08/06 07:50:39
@@ -350,7 +350,7 @@
 
 :- implementation.
 
-:- import_module delay_info, mode_errors, mode_util, globals.
+:- import_module delay_info, mode_errors, mode_util, globals, prog_util.
 :- import_module term, varset.
 :- import_module require, std_util, queue.
 
@@ -474,14 +474,24 @@
 	CheckingExtraGoals = no,
 
 	module_info_globals(ModuleInfo, Globals),
-	body_should_use_typeinfo_liveness(Globals, TypeinfoLiveness),
+	body_should_use_typeinfo_liveness(Globals, TypeInfoLiveness0),
+	(
+		pred_info_module(PredInfo, PredModule),
+		( mercury_public_builtin_module(PredModule)
+		; mercury_private_builtin_module(PredModule)
+		)
+	->
+		TypeInfoLiveness = no
+	;
+		TypeInfoLiveness = TypeInfoLiveness0
+	),
 
 	ModeInfo = mode_info(
 		IOState, ModuleInfo, PredId, ProcId, VarSet, VarTypes,
 		Context, ModeContext, InstMapping0, LockedVars, DelayInfo,
 		ErrorList, LiveVarsList, NondetLiveVarsList, [], [],
 		Changed, HowToCheck, MayChangeProc, CheckingExtraGoals,
-		TypeinfoLiveness, TVarMap
+		TypeInfoLiveness, TVarMap
 	).
 
 %-----------------------------------------------------------------------------%
cvs diff: Diffing notes
--------------------------------------------------------------------------
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