[m-rev.] diff: speed up goal_vars

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Aug 12 09:18:00 AEST 2011


This change reduces the worst-case performance of the compiler in generating
information for the debugger: specifically, the set of variables used in a
procedure body.

When compiling training_cars.m in a debug grade, this change reduces
the compiler's runtime from over 60 seconds to just two.

On tools/speedtest --grade asm_fast.gc.debug, it improves speed by about 0.9%.
On tools/speedtest in the usual asm_fast.gc grade, it has negligible effect.

compiler/goal_util.m:
	Make the goal_vars predicate operate on set_of_progvar, not on
	set(progvar). This makes the worst case performance of the predicate
	dramatically better.

compiler/set_of_var.m:
	Add predicate versions of some functions, to make the conversion
	of code operating on sets easier.

compiler/bytecode_gen.m:
compiler/deforest.m:
compiler/hlds_pred.m:
compiler/ml_proc_gen.m:
compiler/pd_debug.m:
compiler/stack_layout.m:
compiler/stm_expand.m:
compiler/superhomogeneous.m:
	Conform to the change in goal_util.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/bytecode_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/bytecode_gen.m,v
retrieving revision 1.129
diff -u -b -r1.129 bytecode_gen.m
--- compiler/bytecode_gen.m	16 Jun 2011 06:42:13 -0000	1.129
+++ compiler/bytecode_gen.m	11 Aug 2011 08:51:41 -0000
@@ -64,6 +64,7 @@
 :- import_module parse_tree.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_type.
+:- import_module parse_tree.set_of_var.
 
 :- import_module assoc_list.
 :- import_module cord.
@@ -138,8 +139,8 @@
 
     goal_util.goal_vars(Goal, GoalVars),
     proc_info_get_headvars(ProcInfo, ArgVars),
-    set.insert_list(ArgVars, GoalVars, Vars),
-    set.to_sorted_list(Vars, VarList),
+    set_of_var.insert_list(ArgVars, GoalVars, Vars),
+    set_of_var.to_sorted_list(Vars, VarList),
     map.init(VarMap0),
     create_varmap(VarList, VarSet, VarTypes, 0, VarMap0, VarMap, VarInfos),
 
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.102
diff -u -b -r1.102 deforest.m
--- compiler/deforest.m	23 May 2011 05:08:01 -0000	1.102
+++ compiler/deforest.m	11 Aug 2011 08:51:41 -0000
@@ -66,6 +66,7 @@
 :- import_module parse_tree.error_util.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_type_subst.
+:- import_module parse_tree.set_of_var.
 :- import_module transform_hlds.dependency_graph.
 :- import_module transform_hlds.inlining.
 :- import_module transform_hlds.pd_cost.
@@ -1156,10 +1157,10 @@
                 CalledProcInfo1),
             proc_info_get_goal(CalledProcInfo1, CalledGoal1),
             goal_util.goal_vars(CalledGoal1, GoalVars1),
-            set.to_sorted_list(GoalVars1, GoalVarsList1),
-            set.init(GoalVars2),
+            set_of_var.to_sorted_list(GoalVars1, GoalVarsList1),
+            set_of_var.init(GoalVars2),
             goal_util.goals_goal_vars(BetweenGoals, GoalVars2, GoalVars3),
-            set.to_sorted_list(GoalVars3, GoalVarsList3),
+            set_of_var.to_sorted_list(GoalVars3, GoalVarsList3),
 
             list.length(GoalVarsList1, NumVars1),
             list.length(GoalVarsList3, NumVars3),
@@ -1543,7 +1544,7 @@
     map.from_corresponding_lists(FirstVersionArgs, FirstArgs, FirstRenaming0),
 
     goal_util.goal_vars(FirstVersionGoal, FirstVersionVars0),
-    set.to_sorted_list(FirstVersionVars0, FirstVersionVars),
+    set_of_var.to_sorted_list(FirstVersionVars0, FirstVersionVars),
 
     module_info_pred_proc_info(ModuleInfo, FirstPredId, FirstProcId,
         _, FirstProcInfo),
Index: compiler/goal_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.185
diff -u -b -r1.185 goal_util.m
--- compiler/goal_util.m	10 May 2011 04:12:25 -0000	1.185
+++ compiler/goal_util.m	11 Aug 2011 08:51:41 -0000
@@ -28,6 +28,7 @@
 :- import_module mdbcomp.goal_path.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.prog_data.
+:- import_module parse_tree.set_of_var.
 
 :- import_module bool.
 :- import_module list.
@@ -97,13 +98,13 @@
     % if you have a way to do it *without* calling the predicate, you will
     % probably want to it that way.
     %
-:- pred goal_vars(hlds_goal::in, set(prog_var)::out) is det.
+:- pred goal_vars(hlds_goal::in, set_of_progvar::out) is det.
 
     % Do the same job as goal_vars, but for a list of goals, and adding
     % the goal's variables to the accumulator.
     %
 :- pred goals_goal_vars(list(hlds_goal)::in,
-    set(prog_var)::in, set(prog_var)::out) is det.
+    set_of_progvar::in, set_of_progvar::out) is det.
 
     % Return all the variables in a generic call.
     %
@@ -536,21 +537,21 @@
 %-----------------------------------------------------------------------------%
 
 goal_vars(Goal, !:Set) :-
-    set.init(!:Set),
+    !:Set = set_of_var.init,
     goal_vars_2(Goal, !Set).
 
-:- pred goal_vars_2(hlds_goal::in, set(prog_var)::in, set(prog_var)::out)
+:- pred goal_vars_2(hlds_goal::in, set_of_progvar::in, set_of_progvar::out)
     is det.
 
 goal_vars_2(Goal, !Set) :-
     Goal = hlds_goal(GoalExpr, _GoalInfo),
     (
         GoalExpr = unify(Var, RHS, _, Unif, _),
-        set.insert(Var, !Set),
+        set_of_var.insert(Var, !Set),
         (
             Unif = construct(_, _, _, _, CellToReuse, _, _),
             ( CellToReuse = reuse_cell(cell_to_reuse(Var, _, _)) ->
-                set.insert(Var, !Set)
+                set_of_var.insert(Var, !Set)
             ;
                 true
             )
@@ -567,11 +568,11 @@
     ;
         GoalExpr = generic_call(GenericCall, ArgVars, _, _),
         generic_call_vars(GenericCall, GenericCallVars),
-        set.insert_list(GenericCallVars, !Set),
-        set.insert_list(ArgVars, !Set)
+        set_of_var.insert_list(GenericCallVars, !Set),
+        set_of_var.insert_list(ArgVars, !Set)
     ;
         GoalExpr = plain_call(_, _, ArgVars, _, _, _),
-        set.insert_list(ArgVars, !Set)
+        set_of_var.insert_list(ArgVars, !Set)
     ;
         ( GoalExpr = conj(_, Goals)
         ; GoalExpr = disj(Goals)
@@ -579,22 +580,22 @@
         goals_goal_vars(Goals, !Set)
     ;
         GoalExpr = switch(Var, _Det, Cases),
-        set.insert(Var, !Set),
+        set_of_var.insert(Var, !Set),
         cases_goal_vars(Cases, !Set)
     ;
         GoalExpr = scope(Reason, SubGoal),
         (
             Reason = exist_quant(Vars),
-            set.insert_list(Vars, !Set)
+            set_of_var.insert_list(Vars, !Set)
         ;
             Reason = promise_solutions(Vars, _),
-            set.insert_list(Vars, !Set)
+            set_of_var.insert_list(Vars, !Set)
         ;
             Reason = from_ground_term(Var, _),
-            set.insert(Var, !Set)
+            set_of_var.insert(Var, !Set)
         ;
             Reason = require_complete_switch(Var),
-            set.insert(Var, !Set)
+            set_of_var.insert(Var, !Set)
         ;
             ( Reason = promise_purity(_)
             ; Reason = require_detism(_)
@@ -609,7 +610,7 @@
         goal_vars_2(SubGoal, !Set)
     ;
         GoalExpr = if_then_else(Vars, Cond, Then, Else),
-        set.insert_list(Vars, !Set),
+        set_of_var.insert_list(Vars, !Set),
         goal_vars_2(Cond, !Set),
         goal_vars_2(Then, !Set),
         goal_vars_2(Else, !Set)
@@ -617,24 +618,24 @@
         GoalExpr = call_foreign_proc(_, _, _, Args, ExtraArgs, _, _),
         ArgVars = list.map(foreign_arg_var, Args),
         ExtraVars = list.map(foreign_arg_var, ExtraArgs),
-        set.insert_list(ArgVars, !Set),
-        set.insert_list(ExtraVars, !Set)
+        set_of_var.insert_list(ArgVars, !Set),
+        set_of_var.insert_list(ExtraVars, !Set)
     ;
         GoalExpr = shorthand(Shorthand),
         (
             Shorthand = atomic_goal(_, Outer, Inner, MaybeOutputVars,
                 MainGoal, OrElseGoals, _),
             Outer = atomic_interface_vars(OuterDI, OuterUO),
-            set.insert(OuterDI, !Set),
-            set.insert(OuterUO, !Set),
+            set_of_var.insert(OuterDI, !Set),
+            set_of_var.insert(OuterUO, !Set),
             Inner = atomic_interface_vars(InnerDI, InnerUO),
-            set.insert(InnerDI, !Set),
-            set.insert(InnerUO, !Set),
+            set_of_var.insert(InnerDI, !Set),
+            set_of_var.insert(InnerUO, !Set),
             (
                 MaybeOutputVars = no
             ;
                 MaybeOutputVars = yes(OutputVars),
-                set.insert_list(OutputVars, !Set)
+                set_of_var.insert_list(OutputVars, !Set)
             ),
             goal_vars_2(MainGoal, !Set),
             goals_goal_vars(OrElseGoals, !Set)
@@ -655,7 +656,7 @@
     goals_goal_vars(Goals, !Set).
 
 :- pred cases_goal_vars(list(case)::in,
-    set(prog_var)::in, set(prog_var)::out) is det.
+    set_of_progvar::in, set_of_progvar::out) is det.
 
 cases_goal_vars([], !Set).
 cases_goal_vars([case(_, _, Goal) | Cases], !Set) :-
@@ -663,18 +664,18 @@
     cases_goal_vars(Cases, !Set).
 
 :- pred rhs_goal_vars(unify_rhs::in,
-    set(prog_var)::in, set(prog_var)::out) is det.
+    set_of_progvar::in, set_of_progvar::out) is det.
 
 rhs_goal_vars(RHS, !Set) :-
     RHS = rhs_var(X),
-    set.insert(X, !Set).
+    set_of_var.insert(X, !Set).
 rhs_goal_vars(RHS, !Set) :-
     RHS = rhs_functor(_Functor, _, ArgVars),
-    set.insert_list(ArgVars, !Set).
+    set_of_var.insert_list(ArgVars, !Set).
 rhs_goal_vars(RHS, !Set) :-
     RHS = rhs_lambda_goal(_, _, _, _, NonLocals, LambdaVars, _, _, Goal),
-    set.insert_list(NonLocals, !Set),
-    set.insert_list(LambdaVars, !Set),
+    set_of_var.insert_list(NonLocals, !Set),
+    set_of_var.insert_list(LambdaVars, !Set),
     goal_vars_2(Goal, !Set).
 
 generic_call_vars(higher_order(Var, _, _, _), [Var]).
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.273
diff -u -b -r1.273 hlds_pred.m
--- compiler/hlds_pred.m	18 Jul 2011 05:09:35 -0000	1.273
+++ compiler/hlds_pred.m	11 Aug 2011 08:51:41 -0000
@@ -63,6 +63,7 @@
 :- import_module libs.options.
 :- import_module parse_tree.prog_type.
 :- import_module parse_tree.prog_util.
+:- import_module parse_tree.set_of_var.
 
 :- import_module int.
 :- import_module require.
@@ -1205,9 +1206,10 @@
 
     % Remove unneeded variables from the vartypes and varset.
     goal_util.goal_vars(Goal0, GoalVars0),
-    set.insert_list(ArgVars, GoalVars0, GoalVars),
-    map.select(VarTypes0, GoalVars, VarTypes),
-    varset.select(GoalVars, VarSet0, VarSet),
+    set_of_var.insert_list(ArgVars, GoalVars0, GoalVars),
+    GoalVarsSet = set_of_var.bitset_to_set(GoalVars),
+    map.select(VarTypes0, GoalVarsSet, VarTypes),
+    varset.select(GoalVarsSet, VarSet0, VarSet),
 
     % Approximate the termination information for the new procedure.
     ( goal_cannot_loop(ModuleInfo0, Goal0) ->
Index: compiler/ml_proc_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_proc_gen.m,v
retrieving revision 1.14
diff -u -b -r1.14 ml_proc_gen.m
--- compiler/ml_proc_gen.m	16 Jun 2011 06:42:14 -0000	1.14
+++ compiler/ml_proc_gen.m	11 Aug 2011 08:51:41 -0000
@@ -50,6 +50,7 @@
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_foreign.
 :- import_module parse_tree.prog_type.
+:- import_module parse_tree.set_of_var.
 
 :- import_module bool.
 :- import_module getopt_io.
@@ -583,8 +584,8 @@
     Goal = hlds_goal(_, GoalInfo),
     Context = goal_info_get_context(GoalInfo),
     goal_util.goal_vars(Goal, AllVarsSet),
-    set.delete_list(HeadVars, AllVarsSet, LocalVarsSet),
-    set.to_sorted_list(LocalVarsSet, LocalVars),
+    set_of_var.delete_list(HeadVars, AllVarsSet, LocalVarsSet),
+    set_of_var.to_sorted_list(LocalVarsSet, LocalVars),
     ml_gen_local_var_decls(VarSet, VarTypes, Context, LocalVars,
         MLDS_LocalVars0, !Info),
     MLDS_Context = mlds_make_context(Context),
Index: compiler/pd_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_debug.m,v
retrieving revision 1.28
diff -u -b -r1.28 pd_debug.m
--- compiler/pd_debug.m	30 Dec 2010 11:17:57 -0000	1.28
+++ compiler/pd_debug.m	11 Aug 2011 08:51:41 -0000
@@ -70,6 +70,7 @@
 :- import_module libs.options.
 :- import_module parse_tree.mercury_to_mercury.
 :- import_module parse_tree.prog_out.
+:- import_module parse_tree.set_of_var.
 
 :- import_module set.
 
@@ -224,7 +225,8 @@
     pd_info_get_instmap(PDInfo, InstMap),
     pd_info_get_module_info(PDInfo, ModuleInfo),
     io.write_string(Msg, !IO),
-    goal_util.goal_vars(hlds_goal(GoalExpr, GoalInfo), Vars),
+    goal_util.goal_vars(hlds_goal(GoalExpr, GoalInfo), VarsSet),
+    Vars = set_of_var.bitset_to_set(VarsSet),
     instmap_restrict(Vars, InstMap, InstMap1),
     write_instmap(InstMap1, VarSet, yes, 1, !IO),
     io.nl(!IO),
Index: compiler/set_of_var.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/set_of_var.m,v
retrieving revision 1.2
diff -u -b -r1.2 set_of_var.m
--- compiler/set_of_var.m	22 Jul 2011 03:31:41 -0000	1.2
+++ compiler/set_of_var.m	11 Aug 2011 08:51:41 -0000
@@ -27,8 +27,10 @@
 :- type set_of_tvar    == set_of_var(tvar_type).
 
 :- func init = set_of_var(T).
+:- pred init(set_of_var(T)::out) is det.
 
 :- func make_singleton(var(T)) = set_of_var(T).
+:- pred make_singleton(var(T)::in, set_of_var(T)::out) is det.
 
 %---------------
 % Tests.
@@ -47,6 +49,10 @@
 :- func sorted_list_to_set(list(var(T))) = set_of_var(T).
 :- func to_sorted_list(set_of_var(T)) = list(var(T)).
 
+:- pred list_to_set(list(var(T))::in, set_of_var(T)::out) is det.
+:- pred sorted_list_to_set(list(var(T))::in, set_of_var(T)::out) is det.
+:- pred to_sorted_list(set_of_var(T)::in, list(var(T))::out) is det.
+
 :- func set_to_bitset(set(var(T))) = set_of_var(T).
 :- func bitset_to_set(set_of_var(T)) = set(var(T)).
 
@@ -158,8 +164,12 @@
 %-----------------------------------------------------------------------------%
 
 init = tree_bitset.init.                                            % MODULE
+init(Set) :-
+    Set = set_of_var.init.
 
 make_singleton(Elem) = tree_bitset.make_singleton_set(Elem).        % MODULE
+make_singleton(Elem, Set) :-
+    Set = set_of_var.make_singleton(Elem).
 
 %---------------
 % Tests.
@@ -188,6 +198,15 @@
 
 to_sorted_list(Set) = tree_bitset.to_sorted_list(Set).              % MODULE
 
+list_to_set(List, Set) :-
+    Set = set_of_var.list_to_set(List).
+
+sorted_list_to_set(List, Set) :-
+    Set = set_of_var.sorted_list_to_set(List).
+
+to_sorted_list(Set, List) :-
+    List = set_of_var.to_sorted_list(Set).
+
 set_to_bitset(OrdSet) = tree_bitset.from_set(OrdSet).               % MODULE
 
 bitset_to_set(Set) = tree_bitset.to_set(Set).                       % MODULE
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.162
diff -u -b -r1.162 stack_layout.m
--- compiler/stack_layout.m	21 Jul 2011 07:29:49 -0000	1.162
+++ compiler/stack_layout.m	11 Aug 2011 08:51:41 -0000
@@ -115,6 +115,7 @@
 :- import_module ll_backend.trace_gen.
 :- import_module mdbcomp.goal_path.
 :- import_module parse_tree.prog_event.
+:- import_module parse_tree.set_of_var.
 
 :- import_module bool.
 :- import_module char.
@@ -1212,7 +1213,7 @@
         !:VarNumMap = map.init,
         !:Counter = counter.init(1), % to match term.var_supply_init
         goal_util.goal_vars(Goal, GoalVarSet),
-        set.to_sorted_list(GoalVarSet, GoalVars),
+        set_of_var.to_sorted_list(GoalVarSet, GoalVars),
         list.foldl2(add_var_to_var_number_map(VarSet), GoalVars,
             !VarNumMap, !Counter),
         list.foldl2(add_var_to_var_number_map(VarSet), HeadVars,
Index: compiler/stm_expand.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stm_expand.m,v
retrieving revision 1.21
diff -u -b -r1.21 stm_expand.m
--- compiler/stm_expand.m	23 May 2011 05:08:12 -0000	1.21
+++ compiler/stm_expand.m	11 Aug 2011 08:51:41 -0000
@@ -188,6 +188,7 @@
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_mode.
 :- import_module parse_tree.prog_type.
+:- import_module parse_tree.set_of_var.
 
 :- import_module assoc_list.
 :- import_module bool.
@@ -618,12 +619,10 @@
     ModuleInfo = !.StmInfo ^ stm_info_module_info,
 
     goal_vars(HldsGoal, GoalVars0),
-    HldsGoal = hlds_goal(_, GoalInfo),
-
-    set.delete_list(IgnoreVarList, GoalVars0, GoalVars),
-
-    GoalVarList = set.to_sorted_list(GoalVars),
+    set_of_var.delete_list(IgnoreVarList, GoalVars0, GoalVars),
+    GoalVarList = set_of_var.to_sorted_list(GoalVars),
 
+    HldsGoal = hlds_goal(_, GoalInfo),
     GoalNonLocalSet0 = goal_info_get_nonlocals(GoalInfo),
     set.delete_list(IgnoreVarList, GoalNonLocalSet0, GoalNonLocalSet),
     GoalNonLocals = set.to_sorted_list(GoalNonLocalSet),
@@ -637,8 +636,8 @@
     InputVars = set.from_list(InputVarsList),
     OutputVars = set.from_list(OutputVarsList),
 
-    StmGoalVars = stm_goal_vars(InputVars, LocalVars, OutputVars, InnerDI,
-        InnerUO).
+    StmGoalVars = stm_goal_vars(InputVars, LocalVars, OutputVars,
+        InnerDI, InnerUO).
 
 %-----------------------------------------------------------------------------%
 %
@@ -2535,12 +2534,13 @@
 
 new_pred_set_goal(HldsGoal, !NewPredInfo) :-
     ProcInfo0 = !.NewPredInfo ^ new_pred_proc_info,
-    goal_vars(HldsGoal, GoalVars0),
+    goal_vars(HldsGoal, GoalVars),
+    GoalVarsSet = set_of_var.bitset_to_set(GoalVars),
     proc_info_get_varset(ProcInfo0, ProcVarSet0),
     proc_info_get_vartypes(ProcInfo0, ProcVarTypes0),
 
-    varset.select(GoalVars0, ProcVarSet0, ProgVarSet),
-    map.select(ProcVarTypes0, GoalVars0, ProcVarTypes),
+    varset.select(GoalVarsSet, ProcVarSet0, ProgVarSet),
+    map.select(ProcVarTypes0, GoalVarsSet, ProcVarTypes),
 
     proc_info_set_varset(ProgVarSet, ProcInfo0, ProcInfo1),
     proc_info_set_goal(HldsGoal, ProcInfo1, ProcInfo2),
Index: compiler/superhomogeneous.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/superhomogeneous.m,v
retrieving revision 1.45
diff -u -b -r1.45 superhomogeneous.m
--- compiler/superhomogeneous.m	16 May 2011 05:03:41 -0000	1.45
+++ compiler/superhomogeneous.m	11 Aug 2011 08:51:41 -0000
@@ -132,6 +132,7 @@
 :- import_module parse_tree.prog_io_goal.
 :- import_module parse_tree.prog_io_util.
 :- import_module parse_tree.prog_util.
+:- import_module parse_tree.set_of_var.
 
 :- import_module bool.
 :- import_module int.
@@ -1074,9 +1075,9 @@
             % to the proper set of nonlocal arguments.
             some [!LambdaGoalVars] (
                 goal_util.goal_vars(HLDS_Goal, !:LambdaGoalVars),
-                set.delete_list(LambdaVars, !LambdaGoalVars),
-                set.delete_list(QuantifiedVars, !LambdaGoalVars),
-                LambdaNonLocals = set.to_sorted_list(!.LambdaGoalVars)
+                set_of_var.delete_list(LambdaVars, !LambdaGoalVars),
+                set_of_var.delete_list(QuantifiedVars, !LambdaGoalVars),
+                LambdaNonLocals = set_of_var.to_sorted_list(!.LambdaGoalVars)
             ),
 
             LambdaRHS = rhs_lambda_goal(LambdaPurity, Groundness, PredOrFunc,
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