[m-rev.] diff: better filtering of vars of dummy types

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Jul 22 13:29:37 AEST 2011


When computing the interference graph for the stack alloc pass, we used to put
all live variables into the graph, and then filtered out the dummy variables
from every set of live variables. Since a dummy variable can and often does
appear in more than one set, all sets had to be inspected, filtered and then
rebuilt. This rebuilding was redundant work. We now create an array that
tells us which variables are of dummy type (making the test faster), and
avoid putting such variables into live sets in the first place (avoiding
the redundant rebuilding).

This change reduces the time taken by the stack alloc pass for zm_enums.m
in a debug grade by about a quarter (from about 16s to about 12s).

compiler/live_vars.m:
	Add this array to the data structure passed around by the code that
	gathers live sets. Add code to compute the array.

	Pass that data structure to the code that records live sets. We used
	to pass the goal_info, but that turns out to not be needed.

compiler/stack_alloc.m:
	Use the array to filter out dummy variables *before* adding them
	to live sets.

compiler/stack_opt.m:
compiler/tupling.m:
	Conform to the changes in live_vars.m.

compiler/set_of_var.m:
	Add a predicate version of trues-only filter to set_of_var.m.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/extra
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/extra
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops/doc
cvs diff: Diffing boehm_gc/libatomic_ops/src
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/armcc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops/tests
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/m4
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/live_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/live_vars.m,v
retrieving revision 1.146
diff -u -b -r1.146 live_vars.m
--- compiler/live_vars.m	21 Jul 2011 06:58:25 -0000	1.146
+++ compiler/live_vars.m	21 Jul 2011 07:02:02 -0000
@@ -22,13 +22,22 @@
 :- module ll_backend.live_vars.
 :- interface.
 
+:- import_module check_hlds.type_util.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_llds.
 :- import_module hlds.hlds_module.
 :- import_module hlds.hlds_pred.
+:- import_module parse_tree.prog_data.
 :- import_module parse_tree.set_of_var.
 
+:- import_module array.
 :- import_module bool.
+:- import_module list.
+
+%-----------------------------------------------------------------------------%
+
+:- pred build_dummy_type_array(module_info::in, vartypes::in,
+    array(is_dummy_type)::out, list(prog_var)::out) is det.
 
 %-----------------------------------------------------------------------------%
 
@@ -37,15 +46,24 @@
                 ad_module_info          ::  module_info,
                 ad_proc_info            ::  proc_info,
                 ad_typeinfo_liveness    ::  bool,
-                ad_opt_no_return_calls  ::  bool
+                ad_opt_no_return_calls  ::  bool,
+
+                % We want to remove variables of dummy types from the live sets
+                % we generate. The array is indexed by variable number: each
+                % slot says whether the corresponding variable is of a dummy
+                % type or not.
+                %
+                % The array may itself be a dummy if the operations of the
+                % stack_alloc_info type class do not need it.
+                ad_dummy_var_array      ::  array(is_dummy_type)
             ).
 
 :- typeclass stack_alloc_info(T) where [
-    pred at_call_site(need_across_call::in, hlds_goal_info::in,
+    pred at_call_site(need_across_call::in, alloc_data::in,
         T::in, T::out) is det,
-    pred at_resume_site(need_in_resume::in, hlds_goal_info::in,
+    pred at_resume_site(need_in_resume::in, alloc_data::in,
         T::in, T::out) is det,
-    pred at_par_conj(need_in_par_conj::in, hlds_goal_info::in,
+    pred at_par_conj(need_in_par_conj::in, alloc_data::in,
         T::in, T::out) is det
 ].
 
@@ -67,12 +85,53 @@
 :- import_module hlds.instmap.
 :- import_module parse_tree.prog_data.
 
-:- import_module list.
+:- import_module assoc_list.
+:- import_module enum.
+:- import_module int.
 :- import_module map.
+:- import_module pair.
 :- import_module require.
 
 %-----------------------------------------------------------------------------%
 
+build_dummy_type_array(ModuleInfo, VarTypes, DummyTypeArray, DummyVars) :-
+    map.to_assoc_list(VarTypes, VarsTypes),
+    list.foldl(max_var_num, VarsTypes, 0, MaxVarNum),
+    % We want to index the array with variable numbers, which will be from
+    % 1 to MaxVarNum.
+    array.init(MaxVarNum + 1, is_not_dummy_type, DummyTypeArray0),
+    set_dummy_array_elements(ModuleInfo, VarsTypes,
+        DummyTypeArray0, DummyTypeArray, [], DummyVars).
+
+:- pred max_var_num(pair(prog_var, mer_type)::in, int::in, int::out) is det.
+
+max_var_num(Var - _Type, !MaxVarNum) :-
+    VarNum = to_int(Var),
+    int.max(VarNum, !MaxVarNum).
+
+:- pred set_dummy_array_elements(module_info::in,
+    assoc_list(prog_var, mer_type)::in,
+    array(is_dummy_type)::array_di, array(is_dummy_type)::array_uo,
+    list(prog_var)::in, list(prog_var)::out) is det.
+
+set_dummy_array_elements(_, [], !DummyTypeArray, !DummyVars).
+set_dummy_array_elements(ModuleInfo, [VarType | VarsTypes],
+        !DummyTypeArray, !DummyVars) :-
+    VarType = Var - Type,
+    IsDummyType = check_dummy_type(ModuleInfo, Type),
+    (
+        IsDummyType = is_dummy_type,
+        array.set(to_int(Var), IsDummyType, !DummyTypeArray),
+        !:DummyVars = [Var | !.DummyVars]
+    ;
+        IsDummyType = is_not_dummy_type
+        % This is the default; the array slot already has the right value.
+    ),
+    set_dummy_array_elements(ModuleInfo, VarsTypes,
+        !DummyTypeArray, !DummyVars).
+
+%-----------------------------------------------------------------------------%
+
     % Information about which variables in a parallel conjunction need stack
     % slots.
     %
@@ -150,7 +209,8 @@
         ),
         NeedInResume = need_in_resume(ResumeOnStack, ResumeVars1,
             !.NondetLiveness),
-        record_resume_site(NeedInResume, GoalInfo0, GoalInfo1, !StackAlloc)
+        record_resume_site(NeedInResume, AllocData,
+            GoalInfo0, GoalInfo1, !StackAlloc)
     ),
 
     build_live_sets_in_goal_2(GoalExpr0, GoalExpr, GoalInfo1, GoalInfo,
@@ -234,7 +294,8 @@
             % different parallel conjuncts are distinct.
             NeedInParConj = need_in_par_conj(InnerNonLocals `set_of_var.union`
                     set_of_var.union_list(InnerStackVars)),
-            record_par_conj(NeedInParConj, GoalInfo0, GoalInfo, !StackAlloc),
+            record_par_conj(NeedInParConj, AllocData,
+                GoalInfo0, GoalInfo, !StackAlloc),
 
             % All the local variables which needed stack slots in the parallel
             % conjuncts (InnerStackVars) become part of the accumulating set of
@@ -492,7 +553,8 @@
             !.NondetLiveness)
     ),
 
-    record_call_site(NeedAcrossCall, GoalInfo0, GoalInfo, !StackAlloc),
+    record_call_site(NeedAcrossCall, AllocData,
+        GoalInfo0, GoalInfo, !StackAlloc),
 
     % If this is a nondet call, then all the stack slots we need
     % must be protected against reuse in following code.
@@ -676,26 +738,29 @@
 
 %-----------------------------------------------------------------------------%
 
-:- pred record_call_site(need_across_call::in, hlds_goal_info::in,
-    hlds_goal_info::out, T::in, T::out) is det <= stack_alloc_info(T).
+:- pred record_call_site(need_across_call::in, alloc_data::in,
+    hlds_goal_info::in, hlds_goal_info::out, T::in, T::out) is det
+    <= stack_alloc_info(T).
 
-record_call_site(NeedAcrossCall, !GoalInfo, !StackAlloc) :-
+record_call_site(NeedAcrossCall, AllocData, !GoalInfo, !StackAlloc) :-
     goal_info_set_need_across_call(NeedAcrossCall, !GoalInfo),
-    at_call_site(NeedAcrossCall, !.GoalInfo, !StackAlloc).
+    at_call_site(NeedAcrossCall, AllocData, !StackAlloc).
 
-:- pred record_resume_site(need_in_resume::in, hlds_goal_info::in,
-    hlds_goal_info::out, T::in, T::out) is det <= stack_alloc_info(T).
+:- pred record_resume_site(need_in_resume::in, alloc_data::in,
+    hlds_goal_info::in, hlds_goal_info::out, T::in, T::out) is det
+    <= stack_alloc_info(T).
 
-record_resume_site(NeedInResume, !GoalInfo, !StackAlloc) :-
+record_resume_site(NeedInResume, AllocData, !GoalInfo, !StackAlloc) :-
     goal_info_set_need_in_resume(NeedInResume, !GoalInfo),
-    at_resume_site(NeedInResume, !.GoalInfo, !StackAlloc).
+    at_resume_site(NeedInResume, AllocData, !StackAlloc).
 
-:- pred record_par_conj(need_in_par_conj::in, hlds_goal_info::in,
-    hlds_goal_info::out, T::in, T::out) is det <= stack_alloc_info(T).
+:- pred record_par_conj(need_in_par_conj::in, alloc_data::in,
+    hlds_goal_info::in, hlds_goal_info::out, T::in, T::out) is det
+    <= stack_alloc_info(T).
 
-record_par_conj(NeedInParConj, !GoalInfo, !StackAlloc) :-
+record_par_conj(NeedInParConj, AllocData, !GoalInfo, !StackAlloc) :-
     goal_info_set_need_in_par_conj(NeedInParConj, !GoalInfo),
-    at_par_conj(NeedInParConj, !.GoalInfo, !StackAlloc).
+    at_par_conj(NeedInParConj, AllocData, !StackAlloc).
 
 %-----------------------------------------------------------------------------%
 :- end_module ll_backend.live_vars.
Index: compiler/set_of_var.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/set_of_var.m,v
retrieving revision 1.1
diff -u -b -r1.1 set_of_var.m
--- compiler/set_of_var.m	21 Jul 2011 06:58:26 -0000	1.1
+++ compiler/set_of_var.m	20 Jul 2011 02:50:05 -0000
@@ -107,6 +107,8 @@
     %
 :- func filter(pred(var(T))::in(pred(in) is semidet), set_of_var(T)::in)
     = (set_of_var(T)::out) is det.
+:- pred filter(pred(var(T))::in(pred(in) is semidet),
+    set_of_var(T)::in, set_of_var(T)::out) is det.
 
     % `filter(Pred, Set, TrueSet, FalseSet)' returns the elements of Set
     % for which Pred succeeds, and those for which it fails.
@@ -251,6 +253,9 @@
 
 filter(P, Set) = tree_bitset.filter(P, Set).                        % MODULE
 
+filter(P, Set, Trues) :-
+    Trues = tree_bitset.filter(P, Set).                             % MODULE
+
 filter(P, Set, Trues, Falses) :-
      tree_bitset.filter(P, Set, Trues, Falses).                     % MODULE
 
Index: compiler/stack_alloc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_alloc.m,v
retrieving revision 1.30
diff -u -b -r1.30 stack_alloc.m
--- compiler/stack_alloc.m	21 Jul 2011 06:58:27 -0000	1.30
+++ compiler/stack_alloc.m	21 Jul 2011 07:02:46 -0000
@@ -38,6 +38,7 @@
 
 :- implementation.
 
+:- import_module check_hlds.type_util.
 :- import_module hlds.code_model.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_llds.
@@ -50,7 +51,9 @@
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.set_of_var.
 
+:- import_module array.
 :- import_module bool.
+:- import_module enum.
 :- import_module int.
 :- import_module list.
 :- import_module map.
@@ -77,8 +80,10 @@
     body_should_use_typeinfo_liveness(PredInfo, Globals, TypeInfoLiveness),
     globals.lookup_bool_option(Globals, opt_no_return_calls,
         OptNoReturnCalls),
+    proc_info_get_vartypes(!.ProcInfo, VarTypes),
+    build_dummy_type_array(ModuleInfo, VarTypes, DummyTypeArray, DummyVars),
     AllocData = alloc_data(ModuleInfo, !.ProcInfo, TypeInfoLiveness,
-        OptNoReturnCalls),
+        OptNoReturnCalls, DummyTypeArray),
     NondetLiveness0 = set_of_var.init,
     SimpleStackAlloc0 = stack_alloc(set.make_singleton_set(FailVars)),
     proc_info_get_goal(!.ProcInfo, Goal0),
@@ -94,16 +99,14 @@
     (
         MaybeReservedVarInfo = yes(ResVar - _),
         ResVarSet = set_of_var.make_singleton(ResVar),
-        set.insert(ResVarSet, LiveSets0, LiveSets1)
+        set.insert(ResVarSet, LiveSets0, LiveSets)
     ;
         MaybeReservedVarInfo = no,
-        LiveSets1 = LiveSets0
+        LiveSets = LiveSets0
     ),
-    proc_info_get_vartypes(!.ProcInfo, VarTypes),
-    filter_out_dummy_values(ModuleInfo, VarTypes, LiveSets1, LiveSets,
-        DummyVars),
     graph_colour_group_elements(LiveSets, ColourSets),
     set.to_sorted_list(ColourSets, ColourList),
+
     CodeModel = proc_info_interface_code_model(!.ProcInfo),
     allocate_stack_slots(ColourList, CodeModel, NumReservedSlots,
         MaybeReservedVarInfo, StackSlots1),
@@ -111,35 +114,6 @@
         StackSlots1, StackSlots),
     proc_info_set_stack_slots(StackSlots, !ProcInfo).
 
-:- pred filter_out_dummy_values(module_info::in, vartypes::in,
-    set(set_of_progvar)::in, set(set_of_progvar)::out,
-    list(prog_var)::out) is det.
-
-filter_out_dummy_values(ModuleInfo, VarTypes, LiveSet0, LiveSet, DummyVars) :-
-    set.to_sorted_list(LiveSet0, LiveList0),
-    filter_out_dummy_values_2(ModuleInfo, VarTypes, LiveList0, LiveList,
-        set_of_var.init, Dummies),
-    set.list_to_set(LiveList, LiveSet),
-    DummyVars = set_of_var.to_sorted_list(Dummies).
-
-:- pred filter_out_dummy_values_2(module_info::in, vartypes::in,
-    list(set_of_progvar)::in, list(set_of_progvar)::out,
-    set_of_progvar::in, set_of_progvar::out) is det.
-
-filter_out_dummy_values_2(_, _VarTypes, [], [], !Dummies).
-filter_out_dummy_values_2(ModuleInfo, VarTypes,
-        [LiveSet0 | LiveSets0], LiveSets, !Dummies) :-
-    filter_out_dummy_values_2(ModuleInfo, VarTypes, LiveSets0, LiveSets1,
-        !Dummies),
-    set_of_var.filter(var_is_of_dummy_type(ModuleInfo, VarTypes), LiveSet0,
-        DummyVars, NonDummyVars),
-    set_of_var.union(DummyVars, !Dummies),
-    ( set_of_var.is_empty(NonDummyVars) ->
-        LiveSets = LiveSets1
-    ;
-        LiveSets = [NonDummyVars | LiveSets1]
-    ).
-
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -156,40 +130,59 @@
     pred(at_par_conj/4) is alloc_at_par_conj
 ].
 
-:- pred alloc_at_call_site(need_across_call::in, hlds_goal_info::in,
+:- pred alloc_at_call_site(need_across_call::in, alloc_data::in,
     stack_alloc::in, stack_alloc::out) is det.
 
-alloc_at_call_site(NeedAtCall, _GoalInfo, StackAlloc0, StackAlloc) :-
+alloc_at_call_site(NeedAtCall, AllocData, !StackAlloc) :-
     NeedAtCall = need_across_call(ForwardVars, ResumeVars, NondetLiveVars),
-    LiveSet = set_of_var.union_list([ForwardVars, ResumeVars, NondetLiveVars]),
-    StackAlloc0 = stack_alloc(LiveSets0),
+    LiveSet0 = set_of_var.union_list([ForwardVars, ResumeVars, NondetLiveVars]),
+    filter_out_dummy_vars(AllocData, LiveSet0, LiveSet),
+
+    !.StackAlloc = stack_alloc(LiveSets0),
     LiveSets = set.insert(LiveSets0, LiveSet),
-    StackAlloc = stack_alloc(LiveSets).
+    !:StackAlloc = stack_alloc(LiveSets).
 
-:- pred alloc_at_resume_site(need_in_resume::in, hlds_goal_info::in,
+:- pred alloc_at_resume_site(need_in_resume::in, alloc_data::in,
     stack_alloc::in, stack_alloc::out) is det.
 
-alloc_at_resume_site(NeedAtResume, _GoalInfo, StackAlloc0, StackAlloc) :-
+alloc_at_resume_site(NeedAtResume, AllocData, !StackAlloc) :-
     NeedAtResume = need_in_resume(ResumeOnStack, ResumeVars, NondetLiveVars),
     (
-        ResumeOnStack = no,
-        StackAlloc = StackAlloc0
+        ResumeOnStack = no
     ;
         ResumeOnStack = yes,
-        LiveSet = set_of_var.union(ResumeVars, NondetLiveVars),
-        StackAlloc0 = stack_alloc(LiveSets0),
+        LiveSet0 = set_of_var.union(ResumeVars, NondetLiveVars),
+        filter_out_dummy_vars(AllocData, LiveSet0, LiveSet),
+
+        !.StackAlloc = stack_alloc(LiveSets0),
         LiveSets = set.insert(LiveSets0, LiveSet),
-        StackAlloc = stack_alloc(LiveSets)
+        !:StackAlloc = stack_alloc(LiveSets)
     ).
 
-:- pred alloc_at_par_conj(need_in_par_conj::in, hlds_goal_info::in,
+:- pred alloc_at_par_conj(need_in_par_conj::in, alloc_data::in,
     stack_alloc::in, stack_alloc::out) is det.
 
-alloc_at_par_conj(NeedParConj, _GoalInfo, StackAlloc0, StackAlloc) :-
-    NeedParConj = need_in_par_conj(StackVars),
-    StackAlloc0 = stack_alloc(LiveSets0),
+alloc_at_par_conj(NeedParConj, AllocData, !StackAlloc) :-
+    NeedParConj = need_in_par_conj(StackVars0),
+    filter_out_dummy_vars(AllocData, StackVars0, StackVars),
+
+    !.StackAlloc = stack_alloc(LiveSets0),
     LiveSets = set.insert(LiveSets0, StackVars),
-    StackAlloc = stack_alloc(LiveSets).
+    !:StackAlloc = stack_alloc(LiveSets).
+
+:- pred filter_out_dummy_vars(alloc_data::in,
+    set_of_progvar::in, set_of_progvar::out) is det.
+
+filter_out_dummy_vars(AllocData, Vars, NonDummyVars) :-
+    DummyVarArray = AllocData ^ ad_dummy_var_array,
+    set_of_var.filter(var_is_not_dummy(DummyVarArray), Vars, NonDummyVars).
+
+:- pred var_is_not_dummy(array(is_dummy_type)::in, prog_var::in) is semidet.
+
+var_is_not_dummy(DummyVarArray, Var) :-
+    VarNum = to_int(Var),
+    array.lookup(DummyVarArray, VarNum, IsDummy),
+    IsDummy = is_not_dummy_type.
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: compiler/stack_opt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_opt.m,v
retrieving revision 1.54
diff -u -b -r1.54 stack_opt.m
--- compiler/stack_opt.m	21 Jul 2011 06:58:27 -0000	1.54
+++ compiler/stack_opt.m	21 Jul 2011 07:03:06 -0000
@@ -88,6 +88,7 @@
 :- import_module backend_libs.matching.
 :- import_module check_hlds.mode_util.
 :- import_module check_hlds.simplify.
+:- import_module check_hlds.type_util.
 :- import_module hlds.arg_info.
 :- import_module hlds.goal_path.
 :- import_module hlds.hlds_data.
@@ -107,6 +108,7 @@
 :- import_module parse_tree.prog_type.
 :- import_module parse_tree.set_of_var.
 
+:- import_module array.
 :- import_module bool.
 :- import_module counter.
 :- import_module int.
@@ -176,8 +178,9 @@
     body_should_use_typeinfo_liveness(PredInfo, Globals, TypeInfoLiveness),
     globals.lookup_bool_option(Globals, opt_no_return_calls,
         OptNoReturnCalls),
+    array.init(1, is_not_dummy_type, DummyDummyTypeArray),
     AllocData = alloc_data(!.ModuleInfo, !.ProcInfo, TypeInfoLiveness,
-        OptNoReturnCalls),
+        OptNoReturnCalls, DummyDummyTypeArray),
     fill_goal_id_slots_in_proc(!.ModuleInfo, _, !ProcInfo),
     proc_info_get_goal(!.ProcInfo, Goal2),
     OptStackAlloc0 = init_opt_stack_alloc,
@@ -323,24 +326,24 @@
     pred(at_par_conj/4) is opt_at_par_conj
 ].
 
-:- pred opt_at_call_site(need_across_call::in, hlds_goal_info::in,
+:- pred opt_at_call_site(need_across_call::in, alloc_data::in,
     opt_stack_alloc::in, opt_stack_alloc::out) is det.
 
-opt_at_call_site(_NeedAtCall, _GoalInfo, StackAlloc, StackAlloc).
+opt_at_call_site(_NeedAtCall, _AllocData, !StackAlloc).
 
-:- pred opt_at_resume_site(need_in_resume::in, hlds_goal_info::in,
+:- pred opt_at_resume_site(need_in_resume::in, alloc_data::in,
     opt_stack_alloc::in, opt_stack_alloc::out) is det.
 
-opt_at_resume_site(_NeedAtResume, _GoalInfo, StackAlloc, StackAlloc).
+opt_at_resume_site(_NeedAtResume, _AllocData, !StackAlloc).
 
-:- pred opt_at_par_conj(need_in_par_conj::in, hlds_goal_info::in,
+:- pred opt_at_par_conj(need_in_par_conj::in, alloc_data::in,
     opt_stack_alloc::in, opt_stack_alloc::out) is det.
 
-opt_at_par_conj(NeedParConj, _GoalInfo, StackAlloc0, StackAlloc) :-
+opt_at_par_conj(NeedParConj, _AllocData, !StackAlloc) :-
     NeedParConj = need_in_par_conj(StackVars),
-    ParConjOwnSlots0 = StackAlloc0 ^ par_conj_own_slots,
+    ParConjOwnSlots0 = !.StackAlloc ^ par_conj_own_slots,
     ParConjOwnSlots = set_of_var.union(StackVars, ParConjOwnSlots0),
-    StackAlloc = StackAlloc0 ^ par_conj_own_slots := ParConjOwnSlots.
+    !StackAlloc ^ par_conj_own_slots := ParConjOwnSlots.
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: compiler/tupling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tupling.m,v
retrieving revision 1.63
diff -u -b -r1.63 tupling.m
--- compiler/tupling.m	21 Jul 2011 06:58:27 -0000	1.63
+++ compiler/tupling.m	21 Jul 2011 07:00:53 -0000
@@ -99,6 +99,7 @@
 :- import_module backend_libs.
 :- import_module backend_libs.interval.
 :- import_module check_hlds.mode_util.
+:- import_module check_hlds.type_util.
 :- import_module hlds.arg_info.
 :- import_module hlds.goal_path.
 :- import_module hlds.hlds_goal.
@@ -125,6 +126,7 @@
 :- import_module parse_tree.set_of_var.
 :- import_module transform_hlds.dependency_graph.
 
+:- import_module array.
 :- import_module assoc_list.
 :- import_module bool.
 :- import_module counter.
@@ -883,8 +885,9 @@
         body_should_use_typeinfo_liveness(PredInfo, Globals, TypeInfoLiveness),
         globals.lookup_bool_option(Globals,
             opt_no_return_calls, OptNoReturnCalls),
+        array.init(1, is_not_dummy_type, DummyDummyTypeArray),
         AllocData = alloc_data(!.ModuleInfo, !.ProcInfo,
-            TypeInfoLiveness, OptNoReturnCalls),
+            TypeInfoLiveness, OptNoReturnCalls, DummyDummyTypeArray),
         fill_goal_id_slots_in_proc(!.ModuleInfo, ContainingGoalMap, !ProcInfo),
         ReverseGoalPathMap = create_reverse_goal_path_map(ContainingGoalMap),
         map.det_insert(PredProcId, ReverseGoalPathMap,
@@ -916,20 +919,20 @@
     pred(at_par_conj/4) is opt_at_par_conj
 ].
 
-:- pred opt_at_call_site(need_across_call::in, hlds_goal_info::in,
+:- pred opt_at_call_site(need_across_call::in, alloc_data::in,
     opt_tuple_alloc::in, opt_tuple_alloc::out) is det.
 
-opt_at_call_site(_NeedAtCall, _GoalInfo, StackAlloc, StackAlloc).
+opt_at_call_site(_NeedAtCall, _AllocData, !StackAlloc).
 
-:- pred opt_at_resume_site(need_in_resume::in, hlds_goal_info::in,
+:- pred opt_at_resume_site(need_in_resume::in, alloc_data::in,
     opt_tuple_alloc::in, opt_tuple_alloc::out) is det.
 
-opt_at_resume_site(_NeedAtResume, _GoalInfo, StackAlloc, StackAlloc).
+opt_at_resume_site(_NeedAtResume, _AllocData, !StackAlloc).
 
-:- pred opt_at_par_conj(need_in_par_conj::in, hlds_goal_info::in,
+:- pred opt_at_par_conj(need_in_par_conj::in, alloc_data::in,
     opt_tuple_alloc::in, opt_tuple_alloc::out) is det.
 
-opt_at_par_conj(_NeedParConj, _GoalInfo, StackAlloc, StackAlloc).
+opt_at_par_conj(_NeedParConj, _AllocData, !StackAlloc).
 
 %-----------------------------------------------------------------------------%
 
cvs diff: Diffing compiler/notes
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_cairo
cvs diff: Diffing extras/graphics/mercury_cairo/samples
cvs diff: Diffing extras/graphics/mercury_cairo/samples/data
cvs diff: Diffing extras/graphics/mercury_cairo/tutorial
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/monte
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/appengine
cvs diff: Diffing samples/appengine/war
cvs diff: Diffing samples/appengine/war/WEB-INF
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/standalone_c
cvs diff: Diffing samples/concurrency
cvs diff: Diffing samples/concurrency/dining_philosophers
cvs diff: Diffing samples/concurrency/midimon
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/java_interface
cvs diff: Diffing samples/java_interface/java_calls_mercury
cvs diff: Diffing samples/java_interface/mercury_calls_java
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing ssdb
cvs diff: Diffing tests
cvs diff: Diffing tests/analysis
cvs diff: Diffing tests/analysis/ctgc
cvs diff: Diffing tests/analysis/excp
cvs diff: Diffing tests/analysis/ext
cvs diff: Diffing tests/analysis/sharing
cvs diff: Diffing tests/analysis/table
cvs diff: Diffing tests/analysis/trail
cvs diff: Diffing tests/analysis/unused_args
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/stm
cvs diff: Diffing tests/stm/orig
cvs diff: Diffing tests/stm/orig/stm-compiler
cvs diff: Diffing tests/stm/orig/stm-compiler/test1
cvs diff: Diffing tests/stm/orig/stm-compiler/test10
cvs diff: Diffing tests/stm/orig/stm-compiler/test2
cvs diff: Diffing tests/stm/orig/stm-compiler/test3
cvs diff: Diffing tests/stm/orig/stm-compiler/test4
cvs diff: Diffing tests/stm/orig/stm-compiler/test5
cvs diff: Diffing tests/stm/orig/stm-compiler/test6
cvs diff: Diffing tests/stm/orig/stm-compiler/test7
cvs diff: Diffing tests/stm/orig/stm-compiler/test8
cvs diff: Diffing tests/stm/orig/stm-compiler/test9
cvs diff: Diffing tests/stm/orig/stm-compiler-par
cvs diff: Diffing tests/stm/orig/stm-compiler-par/bm1
cvs diff: Diffing tests/stm/orig/stm-compiler-par/bm2
cvs diff: Diffing tests/stm/orig/stm-compiler-par/stmqueue
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test1
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test10
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test11
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test2
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test3
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test4
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test5
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test6
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test7
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test8
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test9
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test1
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test2
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test3
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test4
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test5
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test6
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test7
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test8
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test9
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list