[m-rev.] diff: merge sets of push goals

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Jan 21 17:36:38 AEDT 2011


deep_profiler/mdprof_db.automatic_parallelism.m:
	Merge sets of push goals.

mdbcomp/feedback.automatic_parallelism.m:
	Add back the field that Paul deleted, since it is useful.

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
cvs diff: Diffing compiler/notes
cvs diff: Diffing deep_profiler
Index: deep_profiler/mdprof_fb.automatic_parallelism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/mdprof_fb.automatic_parallelism.m,v
retrieving revision 1.33
diff -u -b -r1.33 mdprof_fb.automatic_parallelism.m
--- deep_profiler/mdprof_fb.automatic_parallelism.m	21 Jan 2011 04:31:52 -0000	1.33
+++ deep_profiler/mdprof_fb.automatic_parallelism.m	21 Jan 2011 06:33:30 -0000
@@ -39,17 +39,17 @@
 
 %-----------------------------------------------------------------------------%
 
-    % Perform Jerome's analysis and update the feedback info structure.
-    %
-:- pred css_list_above_threshold(calls_above_threshold_sorted_opts::in,
-    deep::in, feedback_info::in, feedback_info::out) is det.
-
 :- type calls_above_threshold_sorted_opts
     --->    calls_above_threshold_sorted_opts(
                 cats_measure                :: stat_measure,
                 cats_threshold              :: int
             ).
 
+    % Perform Jerome's analysis and update the feedback info structure.
+    %
+:- pred css_list_above_threshold(calls_above_threshold_sorted_opts::in,
+    deep::in, feedback_info::in, feedback_info::out) is det.
+
 %-----------------------------------------------------------------------------%
 
 :- pred create_candidate_parallel_conj_proc_report(
@@ -564,16 +564,61 @@
 merge_candidate_par_conjs_proc(A, B, Result) :-
     A = candidate_par_conjunctions_proc(VarTableA, PushGoalsA, CPCsA),
     B = candidate_par_conjunctions_proc(VarTableB, PushGoalsB, CPCsB),
-    Result = candidate_par_conjunctions_proc(VarTableA, PushGoals, CPCs),
     CPCs = CPCsA ++ CPCsB,
-    % XXX Merge pushes here.
-    PushGoals = PushGoalsA ++ PushGoalsB,
+    merge_pushes_for_proc(PushGoalsA ++ PushGoalsB, PushGoals),
     ( VarTableA = VarTableB ->
-        true
+        Result = candidate_par_conjunctions_proc(VarTableA, PushGoals, CPCs)
     ;
         unexpected($module, $pred, "var tables do not match")
     ).
 
+:- pred merge_pushes_for_proc(list(push_goal)::in, list(push_goal)::out)
+    is det.
+
+merge_pushes_for_proc([], []).
+merge_pushes_for_proc(Pushes0 @ [_ | _], Pushes) :-
+    list.foldl(insert_into_push_map, Pushes0, map.init, PushMap),
+    map.foldl(extract_from_push_map, PushMap, [], Pushes).
+
+:- pred insert_into_push_map(push_goal::in,
+    map(goal_path_string, {int, int, set(goal_path_string)})::in,
+    map(goal_path_string, {int, int, set(goal_path_string)})::out) is det.
+
+insert_into_push_map(PushGoal, !Map) :-
+    PushGoal = push_goal(GoalPathStr, Lo, Hi, TargetGoalPathStrs),
+    ( map.search(!.Map, GoalPathStr, OldTriple) ->
+        OldTriple = {OldLo, OldHi, OldTargetGoalPathStrSet},
+        (
+            Lo = OldLo,
+            Hi = OldHi
+        ->
+            set.insert_list(OldTargetGoalPathStrSet, TargetGoalPathStrs,
+                NewTargetGoalPathStrSet),
+            NewTriple = {OldLo, OldHi, NewTargetGoalPathStrSet},
+            svmap.det_update(GoalPathStr, NewTriple, !Map)
+        ;
+            % There seem to be separate push requests inside the same
+            % conjunction that want to push different seets of conjuncts.
+            % Since they could interfere with each other, we keep only one.
+            % Since we don't have any good basis on which to make the choice,
+            % we keep the earlier pushes.
+            true
+        )
+    ;
+        NewTriple = {Lo, Hi, set.list_to_set(TargetGoalPathStrs)},
+        svmap.det_insert(GoalPathStr, NewTriple, !Map)
+    ).
+
+:- pred extract_from_push_map(goal_path_string::in,
+    {int, int, set(goal_path_string)}::in,
+    list(push_goal)::in, list(push_goal)::out) is det.
+
+extract_from_push_map(GoalPathStr, Triple, !Pushes) :-
+    Triple = {Lo, Hi, TargetGoalPathStrSet},
+    Push = push_goal(GoalPathStr, Lo, Hi,
+        set.to_sorted_list(TargetGoalPathStrSet)),
+    !:Pushes = [Push | !.Pushes].
+
 %----------------------------------------------------------------------------%
 %
 % Search for paralleliation opportunities within a procedure.
@@ -664,9 +709,9 @@
                 (
                     SeenDuplicateInstantiation =
                         have_not_seen_duplicate_instantiation,
-                    % XXX Merge pushes here.
+                    merge_pushes_for_proc(Pushes, MergedPushes),
                     CandidateProc = candidate_par_conjunctions_proc(VarTable,
-                        Pushes, Candidates0),
+                        MergedPushes, Candidates0),
                     svmap.set(ProcLabel, CandidateProc, map.init, Candidates)
                 ;
                     SeenDuplicateInstantiation = seen_duplicate_instantiation,
@@ -739,7 +784,7 @@
             (
                 SingleCands = [],
                 Candidates = CandidatesBelow,
-                PushesThisLevel = cord.empty,
+                Pushes = PushesBelow,
                 Singles = cord.from_list(SinglesSoFar),
                 Messages = MessagesBelow,
                 Cost = Annotation0 ^ pgd_cost
@@ -747,14 +792,23 @@
                 SingleCands = [CostlyIndex - SinglesBefore],
                 push_and_build_candidate_conjunctions(Info, RevGoalPathSteps,
                     Conjs, CostlyIndex, SinglesBefore,
-                    MessagesThisLevel, CandidatesThisLevel, PushesThisLevel),
-                Candidates = CandidatesBelow ++ CandidatesThisLevel,
-                ( cord.is_empty(CandidatesThisLevel) ->
+                    MessagesThisLevel, CandidatesThisLevel),
+                (
+                    CandidatesThisLevel = [],
+                    Candidates = CandidatesBelow,
+                    Pushes = PushesBelow,
                     % No candidate was built, pass our singles to our caller.
                     Singles = cord.from_list(SinglesSoFar)
                 ;
-                    % Reset signals if we made a candidate our caller cannot
-                    % use them.
+                    CandidatesThisLevel = [FirstCandidate | LaterCandidates],
+                    merge_same_level_pushes(FirstCandidate, LaterCandidates,
+                        PushThisLevel),
+                    Candidates = CandidatesBelow ++
+                        cord.from_list(CandidatesThisLevel),
+                    Pushes = cord.snoc(PushesBelow, PushThisLevel),
+                    % Any single expensive goals inside this conjunction
+                    % cannot have later expensive goals pushed next to them
+                    % without reanalysis of the whole goal, which we do not do.
                     Singles = cord.empty
                 ),
                 Messages = MessagesBelow ++ MessagesThisLevel,
@@ -765,7 +819,7 @@
                 assoc_list.keys(SingleCands, CostlyIndexes),
                 build_candidate_conjunction(Info, RevGoalPathSteps,
                     Conjs, CostlyIndexes, MessagesThisLevel, MaybeCandidate),
-                PushesThisLevel = cord.empty,
+                Pushes = PushesBelow,
                 Messages = MessagesBelow ++ MessagesThisLevel,
                 (
                     MaybeCandidate = yes(Candidate),
@@ -794,8 +848,7 @@
                     Singles = cord.from_list(SinglesSoFar),
                     Cost = Annotation0 ^ pgd_cost
                 )
-            ),
-            Pushes = PushesBelow ++ PushesThisLevel
+            )
         ;
             GoalExpr0 = disj_rep(Disjs0),
             list.map_foldl5(
@@ -1008,7 +1061,7 @@
         info_found_conjs_above_callsite_threshold(NumCostlyGoals),
         !Messages),
 
-    pardgoals_build_candidate_conjunction(Info, Location, RevGoalPathSteps,
+    pardgoals_build_candidate_conjunction(Info, Location, RevGoalPathSteps, no,
         Conjs, MaybeCandidate, !Messages),
     (
         MaybeCandidate = yes(_Candidate),
@@ -1028,36 +1081,32 @@
 :- pred push_and_build_candidate_conjunctions(implicit_parallelism_info::in,
     list(goal_path_step)::in, list(pard_goal_detail)::in, int::in,
     list(pard_goal_detail)::in, cord(message)::out,
-    cord(candidate_par_conjunction(pard_goal_detail))::out,
-    cord(push_goal)::out) is det.
+    list(candidate_par_conjunction(pard_goal_detail))::out) is det.
 
 push_and_build_candidate_conjunctions(_Info, _RevGoalPathSteps, _Conjs,
-        _CostlyIndex, [], cord.empty, cord.empty, cord.empty).
+        _CostlyIndex, [], cord.empty, []).
 push_and_build_candidate_conjunctions(Info, RevGoalPathSteps, Conjs,
-        CostlyIndex, [Single | Singles], Messages, Candidates, Pushes) :-
+        CostlyIndex, [Single | Singles], Messages, Candidates) :-
     push_and_build_candidate_conjunction(Info, RevGoalPathSteps, Conjs,
-        CostlyIndex, Single, HeadMessages, MaybeHeadCandidateAndPush),
+        CostlyIndex, Single, HeadMessages, MaybeHeadCandidate),
     push_and_build_candidate_conjunctions(Info, RevGoalPathSteps, Conjs,
-        CostlyIndex, Singles, TailMessages, TailCandidates, TailPushes),
+        CostlyIndex, Singles, TailMessages, TailCandidates),
     Messages = HeadMessages ++ TailMessages,
     (
-        MaybeHeadCandidateAndPush = yes(HeadCandidate - HeadPush),
-        Candidates = cord.cons(HeadCandidate, TailCandidates),
-        Pushes = cord.cons(HeadPush, TailPushes)
-    ;
-        MaybeHeadCandidateAndPush = no,
-        Candidates = TailCandidates,
-        Pushes = TailPushes
+        MaybeHeadCandidate = yes(HeadCandidate),
+        Candidates = [HeadCandidate | TailCandidates]
+    ;
+        MaybeHeadCandidate = no,
+        Candidates = TailCandidates
     ).
 
 :- pred push_and_build_candidate_conjunction(implicit_parallelism_info::in,
     list(goal_path_step)::in, list(pard_goal_detail)::in, int::in,
     pard_goal_detail::in, cord(message)::out,
-    maybe(pair(candidate_par_conjunction(pard_goal_detail), push_goal))::out)
-    is det.
+    maybe(candidate_par_conjunction(pard_goal_detail))::out) is det.
 
 push_and_build_candidate_conjunction(Info, RevGoalPathSteps, Conjs,
-        CostlyIndex, Single, !:Messages, MaybeCandidateAndPush) :-
+        CostlyIndex, Single, !:Messages, MaybeCandidate) :-
     SingleRevPath = Single ^ goal_annotation ^ pgd_original_path,
     SingleRevPath = rgp(SingleRevSteps),
     list.reverse(SingleRevSteps, SingleSteps),
@@ -1103,22 +1152,52 @@
             RelConjStep + 1, CostlyIndex,
             [goal_path_to_string(fgp(PushGoalSteps))]),
         pardgoals_build_candidate_conjunction(Info, Location,
-            RevCandidateGoalPathSteps, CandidateConjs, MaybeCandidate,
-            !Messages),
+            RevCandidateGoalPathSteps, yes(PushGoal), CandidateConjs,
+            MaybeCandidate, !Messages),
         (
-            MaybeCandidate = yes(Candidate),
+            MaybeCandidate = yes(_),
             append_message(Location,
                 info_found_n_conjunctions_with_positive_speedup(1),
-                !Messages),
-            MaybeCandidateAndPush = yes(Candidate - PushGoal)
+                !Messages)
         ;
-            MaybeCandidate = no,
-            MaybeCandidateAndPush = no
+            MaybeCandidate = no
         )
     ;
         unexpected($module, $pred, "bad goal path for Single")
     ).
 
+:- pred merge_same_level_pushes(
+    candidate_par_conjunction(pard_goal_detail)::in,
+    list(candidate_par_conjunction(pard_goal_detail))::in,
+    push_goal::out) is det.
+
+merge_same_level_pushes(MainCandidate, [], MainPush) :-
+    MaybeMainPush = MainCandidate ^ cpc_maybe_push_goal,
+    (
+        MaybeMainPush = yes(MainPush)
+    ;
+        MaybeMainPush = no,
+        unexpected($module, $pred, "no push")
+    ).
+merge_same_level_pushes(MainCandidate, [HeadCandidate | TailCandidates],
+        Push) :-
+    merge_same_level_pushes(HeadCandidate, TailCandidates, RestPush),
+    MaybeMainPush = MainCandidate ^ cpc_maybe_push_goal,
+    (
+        MaybeMainPush = yes(MainPush)
+    ;
+        MaybeMainPush = no,
+        unexpected($module, $pred, "no push")
+    ),
+    (
+        MainPush = push_goal(GoalPathStr, Lo, Hi, [MainPushInto]),
+        RestPush = push_goal(GoalPathStr, Lo, Hi, RestPushInto)
+    ->
+        Push = push_goal(GoalPathStr, Lo, Hi, [MainPushInto | RestPushInto])
+    ;
+        unexpected($module, $pred, "mismatch on pushed goals")
+    ).
+
 :- pred push_goals_create_candidate(implicit_parallelism_info::in,
     list(goal_path_step)::in, list(goal_path_step)::in,
     pard_goal_detail::in, list(pard_goal_detail)::in,
@@ -1232,12 +1311,13 @@
     ).
 
 :- pred pardgoals_build_candidate_conjunction(implicit_parallelism_info::in,
-    program_location::in, list(goal_path_step)::in, list(pard_goal_detail)::in,
+    program_location::in, list(goal_path_step)::in,
+    maybe(push_goal)::in, list(pard_goal_detail)::in,
     maybe(candidate_par_conjunction(pard_goal_detail))::out,
     cord(message)::in, cord(message)::out) is det.
 
 pardgoals_build_candidate_conjunction(Info, Location, RevGoalPathSteps,
-        Goals, MaybeCandidate, !Messages) :-
+        MaybePushGoal, Goals, MaybeCandidate, !Messages) :-
     % Setting up the first parallel conjunct is a different algorithm to the
     % latter ones, at this point we have the option of moving goals from before
     % the first costly call to either before or during the parallel
@@ -1260,7 +1340,7 @@
         conj_calc_cost(GoalsAfter, Calls, GoalsAfterCost0),
         GoalsAfterCost = goal_cost_get_percall(GoalsAfterCost0),
         RevGoalPathString = rev_goal_path_to_string(rgp(RevGoalPathSteps)),
-        Candidate = candidate_par_conjunction(RevGoalPathString,
+        Candidate = candidate_par_conjunction(RevGoalPathString, MaybePushGoal,
             FirstConjNum, IsDependent, GoalsBefore, GoalsBeforeCost, ParConjs,
             GoalsAfter, GoalsAfterCost, Metrics),
         (
@@ -3334,8 +3414,7 @@
     set.union(ConsumedVarsTail, ConsumedVarsHead, ConsumedVars),
     set.union(BoundVarsTail, BoundVarsHead, BoundVars),
     SeenDuplicateInstantiation = merge_seen_duplicate_instantiation(
-        SeenDuplicateInstantiationHead,
-        SeenDuplicateInstantiationTail).
+        SeenDuplicateInstantiationHead, SeenDuplicateInstantiationTail).
 
 :- pred disj_annotate_with_instmap(list(goal_rep(goal_id))::in,
     seen_duplicate_instantiation::out, set(var_rep)::out, set(var_rep)::out,
@@ -3349,11 +3428,9 @@
         ConsumedVars, BoundVars, InstMap0, InstMap, !InstMapArray) :-
     HeadDetism = Disj ^ goal_detism_rep,
     goal_annotate_with_instmap(Disj, SeenDuplicateInstantiationHead,
-        ConsumedVarsHead, BoundVarsHead, InstMap0, InstMapHead,
-        !InstMapArray),
+        ConsumedVarsHead, BoundVarsHead, InstMap0, InstMapHead, !InstMapArray),
     disj_annotate_with_instmap(Disjs, SeenDuplicateInstantiationTail,
-        ConsumedVarsTail, BoundVarsTail, InstMap0, InstMapTail,
-        !InstMapArray),
+        ConsumedVarsTail, BoundVarsTail, InstMap0, InstMapTail, !InstMapArray),
 
     set.union(ConsumedVarsTail, ConsumedVarsHead, ConsumedVars),
 
@@ -3374,8 +3451,7 @@
     ),
     InstMap = merge_inst_map(InstMapHead, HeadDetism, InstMapTail, TailDetism),
     SeenDuplicateInstantiation = merge_seen_duplicate_instantiation(
-        SeenDuplicateInstantiationHead,
-        SeenDuplicateInstantiationTail).
+        SeenDuplicateInstantiationHead, SeenDuplicateInstantiationTail).
 
 :- pred switch_annotate_with_instmap(list(case_rep(goal_id))::in,
     seen_duplicate_instantiation::out, set(var_rep)::out, set(var_rep)::out,
@@ -3390,11 +3466,9 @@
     Case = case_rep(_, _, Goal),
     HeadDetism = Goal ^ goal_detism_rep,
     goal_annotate_with_instmap(Goal, SeenDuplicateInstantiationHead,
-        ConsumedVarsHead, BoundVarsHead, InstMap0, InstMapHead,
-        !InstMapArray),
+        ConsumedVarsHead, BoundVarsHead, InstMap0, InstMapHead, !InstMapArray),
     switch_annotate_with_instmap(Cases, SeenDuplicateInstantiationTail,
-        ConsumedVarsTail, BoundVarsTail, InstMap0, InstMapTail,
-        !InstMapArray),
+        ConsumedVarsTail, BoundVarsTail, InstMap0, InstMapTail, !InstMapArray),
     set.union(ConsumedVarsTail, ConsumedVarsHead, ConsumedVars),
     % merge_inst_map requires the detism of goals that produce both inst maps,
     % we can create fake values that satisfy merge_inst_map easily.
@@ -3409,8 +3483,7 @@
     ),
     InstMap = merge_inst_map(InstMapHead, HeadDetism, InstMapTail, TailDetism),
     SeenDuplicateInstantiation = merge_seen_duplicate_instantiation(
-        SeenDuplicateInstantiationHead,
-        SeenDuplicateInstantiationTail).
+        SeenDuplicateInstantiationHead, SeenDuplicateInstantiationTail).
 
 :- pred ite_annotate_with_instmap(goal_rep(goal_id)::in,
     goal_rep(goal_id)::in, goal_rep(goal_id)::in,
@@ -3604,7 +3677,7 @@
 create_candidate_parallel_conj_report(VarTable, CandidateParConjunction,
         Report) :-
     CandidateParConjunction = candidate_par_conjunction(GoalPathString,
-        FirstConjNum, IsDependent, GoalsBefore, GoalsBeforeCost,
+        MaybePushGoal, FirstConjNum, IsDependent, GoalsBefore, GoalsBeforeCost,
         Conjs, GoalsAfter, GoalsAfterCost, ParExecMetrics),
     ParExecMetrics = parallel_exec_metrics(NumCalls, SeqTime, ParTime,
         ParOverheads, FirstConjDeadTime, FutureDeadTime),
@@ -3626,6 +3699,22 @@
         [s(GoalPathString)], Header1Str),
     Header1 = cord.singleton(Header1Str),
 
+    (
+        MaybePushGoal = no,
+        Header2 = cord.empty
+    ;
+        MaybePushGoal = yes(PushGoal),
+        PushGoal = push_goal(PushGoalPathStr, Lo, Hi, PushedGoalPathStrs),
+        string.format("      PushGoal: %s, lo %d, hi %d\n",
+            [s(PushGoalPathStr), i(Lo), i(Hi)], HeadPushGoalStr),
+        FormatPushedGoals = (
+            func(PushedGoalPathStr) = 
+                string.format("                %s\n", [s(PushedGoalPathStr)])
+        ),
+        TailPushGoalStrs = list.map(FormatPushedGoals, PushedGoalPathStrs),
+        Header2 = cord.from_list([HeadPushGoalStr | TailPushGoalStrs])
+    ),
+
     string.format(
         "      Dependent: %s\n" ++
         "      NumCalls: %s\n" ++
@@ -3648,7 +3737,7 @@
          s(two_decimal_fraction(FutureDeadTime)),
          s(two_decimal_fraction(TotalDeadTime))],
         Header2Str),
-    Header2 = cord.singleton(Header2Str),
+    Header3 = cord.singleton(Header2Str),
 
     ( rev_goal_path_from_string(GoalPathString, RevGoalPath) ->
         RevGoalPath = rgp(RevGoalPathSteps)
@@ -3674,7 +3763,7 @@
         ReportGoalsAfter = indent(3) ++ singleton("Goals after:\n") ++
             ReportGoalsAfter0
     ),
-    Report = Header1 ++ Header2 ++ ReportGoalsBefore ++ nl
+    Report = Header1 ++ Header2 ++ Header3 ++ ReportGoalsBefore ++ nl
         ++ ReportParConj ++ nl ++ ReportGoalsAfter ++ nl.
 
 :- pred format_parallel_conjunction(var_table::in, int::in,
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
Index: mdbcomp/feedback.automatic_parallelism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/feedback.automatic_parallelism.m,v
retrieving revision 1.13
diff -u -b -r1.13 feedback.automatic_parallelism.m
--- mdbcomp/feedback.automatic_parallelism.m	21 Jan 2011 04:31:52 -0000	1.13
+++ mdbcomp/feedback.automatic_parallelism.m	21 Jan 2011 06:04:39 -0000
@@ -27,6 +27,7 @@
 
 :- import_module bool.
 :- import_module list.
+:- import_module maybe.
 :- import_module set.
 :- import_module string.
 
@@ -197,6 +198,13 @@
                 % The path within the procedure to this conjunction.
                 cpc_goal_path           :: goal_path_string,
 
+                % If the candidate is dependent on a push being performed,
+                % what is that push? Note that any push that specifies the same
+                % goals being pushed and the same OR GREATER set of goals next
+                % to which to push them is acceptable: if such a push is
+                % performed, then this candidate is viable.
+                cpc_maybe_push_goal     :: maybe(push_goal),
+
                 % The position within the original conjunction that this
                 % parallelisation starts.
                 cpc_first_conj_num      :: int,
@@ -372,21 +380,21 @@
     CPCProcB = candidate_par_conjunctions_proc(VarTable, PushGoals, CPCB).
 
 convert_candidate_par_conjunction(Conv0, CPC0, CPC) :-
-    CPC0 = candidate_par_conjunction(GoalPath, FirstGoalNum,
-        IsDependent, GoalsBefore0, GoalsBeforeCost, Conjs0, GoalsAfter0,
-        GoalsAfterCost, Metrics),
+    CPC0 = candidate_par_conjunction(GoalPath, MaybePushGoal, FirstGoalNum,
+        IsDependent, GoalsBefore0, GoalsBeforeCost, Conjs0,
+        GoalsAfter0, GoalsAfterCost, Metrics),
     Conv = (pred(A::in, B::out) is det :-
             Conv0(CPC0, A, B)
         ),
     list.map(convert_seq_conj(Conv), Conjs0, Conjs),
     list.map(Conv, GoalsBefore0, GoalsBefore),
     list.map(Conv, GoalsAfter0, GoalsAfter),
-    CPC = candidate_par_conjunction(GoalPath, FirstGoalNum,
-        IsDependent, GoalsBefore, GoalsBeforeCost, Conjs, GoalsAfter,
-        GoalsAfterCost, Metrics).
+    CPC = candidate_par_conjunction(GoalPath, MaybePushGoal, FirstGoalNum,
+        IsDependent, GoalsBefore, GoalsBeforeCost, Conjs,
+        GoalsAfter, GoalsAfterCost, Metrics).
 
 convert_seq_conj(Conv, seq_conj(Conjs0), seq_conj(Conjs)) :-
-    map(Conv, Conjs0, Conjs).
+    list.map(Conv, Conjs0, Conjs).
 
 %-----------------------------------------------------------------------------%
 :- end_module mdbcomp.feedback.automatic_parallelism.
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/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