[m-rev.] for possible review: frameopt performance fix

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Jul 30 15:32:07 AEST 2010


I will address any comments on this diff after commit.

Zoltan.

Fix a performance problem in frameopt. Before this fix, the invocation
of frameopt on one small predicate (mlds_to_java.m's output_interface,
in which interface_is_special was inlined) took about 6 seconds out
of the compiler's entire runtime of 9.8 seconds, and the only thing
frameopt do during those 6 seconds to was decide to change nothing.

compiler/frameopt.m:
	When we decide that a basic block needs a stack frame, store
	that decision itself, but do NOT store a set of reasons that say
	WHY the block needs the stack frame. The 6 seconds was almost entirely
	taken up by the code managing these sets of reasons, because (a)
	for many blocks, there were many reasons, and (b) the reasons
	themselves contained other (sets of) reasons, so they were big.

compiler/mlds_to_java.m:
	Improve the style of output_interface.

compiler/optimize.m:
	If the user asks for detail (per-pass) statistics, print them out
	more frequently. This was needed to diagnose this problem.

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/frameopt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/frameopt.m,v
retrieving revision 1.117
diff -u -b -r1.117 frameopt.m
--- compiler/frameopt.m	21 Oct 2009 06:36:19 -0000	1.117
+++ compiler/frameopt.m	30 Jul 2010 02:39:18 -0000
@@ -397,7 +397,7 @@
 
 :- type block_type(EntryInfo, ExitInfo)
     --->    entry_block(EntryInfo)
-    ;       ordinary_block(block_needs_frame(needs_frame_reason), maybe_dummy)
+    ;       ordinary_block(block_needs_frame, maybe_dummy)
     ;       exit_block(ExitInfo).
 
 :- type maybe_dummy
@@ -405,32 +405,13 @@
     ;       is_post_entry_dummy
     ;       is_pre_exit_dummy.
 
-:- type block_needs_frame(T)
-    --->    block_needs_frame(T)
+    % Until 30 July 2010, we used to keep a set of reasons *why* a block
+    % needs a frame. If that info can be useful to you, revert that diff
+    % in your workspace.
+:- type block_needs_frame
+    --->    block_needs_frame
     ;       block_doesnt_need_frame.
 
-:- type needs_frame_reasons == set(needs_frame_reason).
-
-:- type needs_frame_reason
-    --->    code_needs_frame(label)
-            % The code of the block of this label needs a frame.
-
-    ;       keep_frame
-
-    ;       redoip_label
-
-    ;       jump_around(label, needs_frame_reasons)
-
-    ;       frontier(label, needs_frame_reasons)
-
-    ;       succ_propagated(label, needs_frame_reason)
-            % The reason given by the second arg is propagated to its
-            % successors, including the block of the first argument.
-
-    ;       pred_propagated(label, needs_frame_reason).
-            % The reason given by the second arg is propagated to its
-            % predecessors, including the block of the first argument.
-
 :- type det_entry_info
     --->    det_entry(
                 int,            % The frame size.
@@ -1068,13 +1049,14 @@
     % Does an ordinary block with the given content need a stack frame?
     %
 :- pred compute_block_needs_frame(label::in, list(instruction)::in,
-    block_needs_frame(needs_frame_reason)::out) is det.
+    block_needs_frame::out) is det.
 
-compute_block_needs_frame(Label, Instrs, NeedsFrame) :-
+% ZZZ
+compute_block_needs_frame(_Label, Instrs, NeedsFrame) :-
     opt_util.block_refers_to_stack(Instrs) = ReferStackVars,
     (
         ReferStackVars = yes,
-        NeedsFrame = block_needs_frame(code_needs_frame(Label))
+        NeedsFrame = block_needs_frame
     ;
         ReferStackVars = no,
         (
@@ -1107,7 +1089,7 @@
                 Uinstr = assign(succip, _)
             )
         ->
-            NeedsFrame = block_needs_frame(code_needs_frame(Label))
+            NeedsFrame = block_needs_frame
         ;
             NeedsFrame = block_doesnt_need_frame
         )
@@ -1188,7 +1170,7 @@
     BlockInfo0 = frame_block_info(BlockLabel, BlockInstrs0, FallInto,
         _, _, Type),
     (
-        Type = ordinary_block(block_needs_frame(_), _),
+        Type = ordinary_block(block_needs_frame, _),
         !:AnyBlockNeedsFrame = yes
     ;
         ( Type = ordinary_block(block_doesnt_need_frame, _)
@@ -1334,8 +1316,7 @@
         unexpected(this_file, "mark_redoip_label: entry_block")
     ;
         BlockType0 = ordinary_block(_, MaybeDummy),
-        Reason = redoip_label,
-        BlockType = ordinary_block(block_needs_frame(Reason), MaybeDummy),
+        BlockType = ordinary_block(block_needs_frame, MaybeDummy),
         BlockInfo = BlockInfo0 ^ fb_type := BlockType,
         svmap.det_update(Label, BlockInfo, !BlockMap)
     ;
@@ -1410,8 +1391,7 @@
             BackInstrs = LivevalsGoto
         ),
         Instrs = [OrigLabelInstr | BackInstrs],
-        Reason = keep_frame,
-        BlockType = ordinary_block(block_needs_frame(Reason), is_not_dummy),
+        BlockType = ordinary_block(block_needs_frame, is_not_dummy),
         BlockInfo = frame_block_info(Label, Instrs, FallInto, [SecondLabel],
             no, BlockType),
         map.det_update(!.BlockMap, Label, BlockInfo, !:BlockMap)
@@ -1599,21 +1579,19 @@
 
 max_propagation_steps = 10000.
 
-:- pred key_block_needs_frame(
-    pair(label, block_needs_frame(needs_frame_reasons))::in,
-    pair(needs_frame_reason, label)::out) is semidet.
+:- pred key_block_needs_frame(pair(label, block_needs_frame)::in, label::out)
+    is semidet.
 
-key_block_needs_frame(Label - block_needs_frame(Reasons),
-    frontier(Label, Reasons) - Label).
+key_block_needs_frame(Label - block_needs_frame, Label).
 
 %-----------------------------------------------------------------------------%
 
     % Maps the label of each ordinary block to a bool that says whether
     % the block needs a stack frame or not.
     %
-:- type ord_needs_frame == map(label, block_needs_frame(needs_frame_reasons)).
+:- type ord_needs_frame == map(label, block_needs_frame).
 
-:- type prop_queue == queue(pair(needs_frame_reason, label)).
+:- type prop_queue == queue(label).
 
     % Initialize the data structures for the delaying operation.
     % The first is a map showing the predecessors of each block,
@@ -1641,11 +1619,9 @@
             NeedsFrame = block_doesnt_need_frame,
             svmap.det_insert(Label, block_doesnt_need_frame, !OrdNeedsFrame)
         ;
-            NeedsFrame = block_needs_frame(Reason),
-            Reasons = make_singleton_set(Reason),
-            svmap.det_insert(Label, block_needs_frame(Reasons),
-                !OrdNeedsFrame),
-            svqueue.put(Reason - Label, !Queue)
+            NeedsFrame = block_needs_frame,
+            svmap.det_insert(Label, block_needs_frame, !OrdNeedsFrame),
+            svqueue.put(Label, !Queue)
         )
     ;
         BlockType = exit_block(_)
@@ -1669,19 +1645,16 @@
 
 %-----------------------------------------------------------------------------%
 
-:- pred ord_needs_frame(label::in, needs_frame_reason::in,
+:- pred ord_needs_frame(label::in,
     ord_needs_frame::in, ord_needs_frame::out) is det.
 
-ord_needs_frame(Label, CurReason, !OrdNeedsFrame) :-
+ord_needs_frame(Label, !OrdNeedsFrame) :-
     map.lookup(!.OrdNeedsFrame, Label, NeedsFrame0),
     (
         NeedsFrame0 = block_doesnt_need_frame,
-        Reasons = make_singleton_set(CurReason),
-        svmap.det_update(Label, block_needs_frame(Reasons), !OrdNeedsFrame)
+        svmap.det_update(Label, block_needs_frame, !OrdNeedsFrame)
     ;
-        NeedsFrame0 = block_needs_frame(Reasons0),
-        set.insert(Reasons0, CurReason, Reasons),
-        svmap.det_update(Label, block_needs_frame(Reasons), !OrdNeedsFrame)
+        NeedsFrame0 = block_needs_frame
     ).
 
     % Given a queue of labels representing ordinary blocks that must have
@@ -1704,14 +1677,14 @@
         !.CanTransform = can_transform,
         ( !.PropagationStepsLeft < 0 ->
             !:CanTransform = cannot_transform
-        ; svqueue.get(Reason - Label, !Queue) ->
+        ; svqueue.get(Label, !Queue) ->
             !:PropagationStepsLeft = !.PropagationStepsLeft - 1,
             svset.insert(Label, !AlreadyProcessed),
             map.lookup(BlockMap, Label, BlockInfo),
             BlockType = BlockInfo ^ fb_type,
             (
                 BlockType = ordinary_block(_, _MaybeDummy),
-                ord_needs_frame(Label, Reason, !OrdNeedsFrame),
+                ord_needs_frame(Label, !OrdNeedsFrame),
                 % Putting an already processed label into the queue could
                 % lead to an infinite loop. However, we cannot decide whether
                 % a label has been processed by checking whether
@@ -1723,9 +1696,7 @@
                 % to do that for exit frames.
                 list.filter(set.contains(!.AlreadyProcessed),
                     successors(BlockInfo), _, UnprocessedSuccessors),
-                list.map(pair_with(succ_propagated(Label, Reason)),
-                    UnprocessedSuccessors, PairedUnprocessedSuccessors),
-                svqueue.put_list(PairedUnprocessedSuccessors, !Queue)
+                svqueue.put_list(UnprocessedSuccessors, !Queue)
             ;
                 BlockType = entry_block(_),
                 !:CanTransform = cannot_transform
@@ -1757,7 +1728,7 @@
         !.CanTransform = can_transform,
         ( !.PropagationStepsLeft < 0 ->
             !:CanTransform = cannot_transform
-        ; svqueue.get(Reason - Label, !Queue) ->
+        ; svqueue.get(Label, !Queue) ->
             !:PropagationStepsLeft = !.PropagationStepsLeft - 1,
             ( map.search(RevMap, Label, PredecessorsPrime) ->
                 Predecessors = PredecessorsPrime
@@ -1768,17 +1739,15 @@
                 % Label on the stack, and thus is already known to need
                 % a stack frame.
                 Predecessors = [],
-                ord_needs_frame(Label, Reason, !OrdNeedsFrame)
+                ord_needs_frame(Label, !OrdNeedsFrame)
             ),
             list.filter(all_successors_need_frame(BlockMap, !.OrdNeedsFrame),
                 Predecessors, NowNeedFrameLabels),
-            list.foldl2(record_frame_need(BlockMap, Reason), NowNeedFrameLabels,
+            list.foldl2(record_frame_need(BlockMap), NowNeedFrameLabels,
                 !OrdNeedsFrame, !CanTransform),
             % XXX map.lookup(BlockMap, Label, BlockInfo),
             % XXX Successors = successors(BlockInfo),
-            list.map(pair_with(pred_propagated(Label, Reason)),
-                NowNeedFrameLabels, PairedNowNeedFrameLabels),
-            svqueue.put_list(PairedNowNeedFrameLabels, !Queue),
+            svqueue.put_list(NowNeedFrameLabels, !Queue),
             propagate_frame_requirement_to_predecessors(!.Queue, BlockMap,
                 RevMap, !OrdNeedsFrame, !PropagationStepsLeft, !CanTransform)
         ;
@@ -1786,11 +1755,11 @@
         )
     ).
 
-:- pred record_frame_need(frame_block_map(En, Ex)::in, needs_frame_reason::in,
+:- pred record_frame_need(frame_block_map(En, Ex)::in,
     label::in, ord_needs_frame::in, ord_needs_frame::out,
     can_transform::in, can_transform::out) is det.
 
-record_frame_need(BlockMap, Reason, Label, !OrdNeedsFrame, !CanTransform) :-
+record_frame_need(BlockMap, Label, !OrdNeedsFrame, !CanTransform) :-
     map.lookup(BlockMap, Label, BlockInfo),
     BlockType = BlockInfo ^ fb_type,
     (
@@ -1798,7 +1767,7 @@
         !:CanTransform = cannot_transform
     ;
         BlockType = ordinary_block(_, _),
-        ord_needs_frame(Label, Reason, !OrdNeedsFrame)
+        ord_needs_frame(Label, !OrdNeedsFrame)
     ;
         BlockType = exit_block(_),
         unexpected(this_file, "record_frame_need: exit_block")
@@ -1818,7 +1787,7 @@
 
 label_needs_frame(OrdNeedsFrame, Label) :-
     ( map.search(OrdNeedsFrame, Label, NeedsFrame) ->
-        NeedsFrame = block_needs_frame(_)
+        NeedsFrame = block_needs_frame
     ;
         % If the map.search fails, Label is not an ordinary frame.
         % Entry blocks and exit blocks don't need frames.
@@ -1882,7 +1851,7 @@
         Type = ordinary_block(_, _),
         map.lookup(OrdNeedsFrame, Label0, NeedsFrame),
         (
-            NeedsFrame = block_needs_frame(_),
+            NeedsFrame = block_needs_frame,
             % Every block reachable from this block, whether via jump or
             % fallthrough, will be an ordinary block also mapped to `yes'
             % by OrdNeedsFrame, or will be an exit block, or will be a pre-exit
@@ -2028,7 +1997,7 @@
         Type = ordinary_block(_, _),
         map.lookup(OrdNeedsFrame, Label0, NeedsFrame),
         (
-            NeedsFrame = block_needs_frame(_),
+            NeedsFrame = block_needs_frame,
             ensure_setup_parallel(Label0, Label, ProcLabel, !C, !SetupParMap)
         ;
             NeedsFrame = block_doesnt_need_frame,
@@ -2092,7 +2061,7 @@
                 svmap.det_update(Label0, BlockInfo, !BlockMap),
                 ParallelBlockFallInto = FallInto
             ;
-                PrevNeedsFrame = block_needs_frame(_),
+                PrevNeedsFrame = block_needs_frame,
                 Labels = [Label0, ParallelLabel | Labels1],
                 ParallelBlockFallInto = no
             ),
@@ -2111,7 +2080,7 @@
             "create_parallels: block in setup map is not ordinary"),
         PrevNeedsFrame = prev_block_needs_frame(OrdNeedsFrame, BlockInfo0),
         (
-            PrevNeedsFrame = block_needs_frame(Reasons),
+            PrevNeedsFrame = block_needs_frame,
             counter.allocate(N, !C),
             JumpAroundLabel = internal_label(N, ProcLabel),
             % By not including a label instruction at the start of
@@ -2124,11 +2093,9 @@
             JumpAroundCode =
                 [llds_instr(goto(code_label(Label0)), "jump around setup")],
             Labels = [JumpAroundLabel, SetupLabel, Label0 | Labels1],
-            JumpAroundReason = jump_around(Label0, Reasons),
             JumpAroundBlockInfo = frame_block_info(JumpAroundLabel,
                 JumpAroundCode, no, [Label0], FallInto,
-                ordinary_block(block_needs_frame(JumpAroundReason),
-                    is_not_dummy)),
+                ordinary_block(block_needs_frame, is_not_dummy)),
             svmap.det_insert(JumpAroundLabel, JumpAroundBlockInfo, !BlockMap),
             SetupFallInto = yes(JumpAroundLabel),
             BlockInfo = BlockInfo0 ^ fb_fallen_into := yes(SetupLabel),
@@ -2148,7 +2115,7 @@
     ).
 
 :- func prev_block_needs_frame(ord_needs_frame, frame_block_info(En, Ex)) =
-    block_needs_frame(needs_frame_reasons).
+    block_needs_frame.
 
 prev_block_needs_frame(OrdNeedsFrame, BlockInfo) = PrevNeedsFrame :-
     MaybeFallIntoFrom = BlockInfo ^ fb_fallen_into,
@@ -2303,17 +2270,11 @@
             TypeStr0 = "ordinary_block (pre_exit_dummy); "
         ),
         (
-            UsesFrame = block_needs_frame(UsesReason),
-            TypeStr1 = TypeStr0 ++ "uses frame",
-            ( UsesReason = code_needs_frame(Label) ->
-                TypeStr2 = TypeStr1 ++ "\n"
-            ;
-                TypeStr2 = TypeStr1 ++ " " ++
-                    describe_reason(YesProcLabel, UsesReason) ++ "\n"
-            )
+            UsesFrame = block_needs_frame,
+            TypeStr1 = TypeStr0 ++ "uses frame\n"
         ;
             UsesFrame = block_doesnt_need_frame,
-            TypeStr2 = TypeStr0 ++ "does not use frame\n"
+            TypeStr1 = TypeStr0 ++ "does not use frame\n"
         ),
         ( map.search(OrdNeedsFrame, Label, NeedsFrame) ->
             (
@@ -2322,16 +2283,14 @@
                     "describe_block: "
                     ++ "NeedsFrame=block_doesnt_need_frame, "
                     ++ "UsesFrame=block_needs_frame"),
-                TypeStr = TypeStr2 ++ "does not need frame\n"
+                TypeStr = TypeStr1 ++ "does not need frame\n"
             ;
-                NeedsFrame = block_needs_frame(NeedsReasonSet),
-                set.to_sorted_list(NeedsReasonSet, NeedsReasons),
-                ReasonsStr = describe_top_reasons(YesProcLabel, NeedsReasons),
-                TypeStr = TypeStr2 ++ "does need frame\n" ++ ReasonsStr
+                NeedsFrame = block_needs_frame,
+                TypeStr = TypeStr1 ++ "does need frame\n"
             )
         ;
             % We can get here if delay_frame_transform fails.
-            TypeStr = TypeStr2 ++ "(unknown whether it does need frame)\n"
+            TypeStr = TypeStr1 ++ "(unknown whether it does need frame)\n"
         )
     ;
         Type = exit_block(Exit),
@@ -2392,42 +2351,6 @@
     ++ "goto:     "
     ++ dump_fullinstr(MaybeProcLabel, yes, Goto).
 
-:- func describe_top_reasons(maybe(proc_label), list(needs_frame_reason))
-    = string.
-
-describe_top_reasons(_MaybeProcLabel, []) = "".
-describe_top_reasons(MaybeProcLabel, [Reason | Reasons]) =
-    describe_reason(MaybeProcLabel, Reason) ++ "\n" ++
-    describe_top_reasons(MaybeProcLabel, Reasons).
-
-:- func describe_reason(maybe(proc_label), needs_frame_reason) = string.
-
-describe_reason(MaybeProcLabel, code_needs_frame(Label)) =
-    "code " ++ dump_label(MaybeProcLabel, Label).
-describe_reason(_MaybeProcLabel, keep_frame) = "keep_frame".
-describe_reason(_MaybeProcLabel, redoip_label) = "redoip_label".
-describe_reason(MaybeProcLabel, frontier(Label, Reasons)) =
-    "frontier(" ++ dump_label(MaybeProcLabel, Label) ++ ", {"
-        ++ describe_reasons(MaybeProcLabel, to_sorted_list(Reasons)) ++ "})".
-describe_reason(MaybeProcLabel, jump_around(Label, Reasons)) =
-    "jump_around(" ++ dump_label(MaybeProcLabel, Label) ++ ", {"
-        ++ describe_reasons(MaybeProcLabel, to_sorted_list(Reasons)) ++ "})".
-describe_reason(MaybeProcLabel, succ_propagated(Label, Reason)) =
-    "successor(" ++ dump_label(MaybeProcLabel, Label) ++ ", "
-        ++ describe_reason(MaybeProcLabel, Reason) ++ ")".
-describe_reason(MaybeProcLabel, pred_propagated(Label, Reason)) =
-    "predecessor(" ++ dump_label(MaybeProcLabel, Label) ++ ", "
-        ++ describe_reason(MaybeProcLabel, Reason) ++ ")".
-
-:- func describe_reasons(maybe(proc_label), list(needs_frame_reason)) = string.
-
-describe_reasons(_, []) = "".
-describe_reasons(MaybeProcLabel, [Reason]) =
-    describe_reason(MaybeProcLabel, Reason).
-describe_reasons(MaybeProcLabel, [Reason1, Reason2 | Reasons]) =
-    describe_reason(MaybeProcLabel, Reason1) ++ ", " ++
-    describe_reasons(MaybeProcLabel, [Reason2 | Reasons]).
-
 %-----------------------------------------------------------------------------%
 
 :- pred search_setup_par_map(setup_par_map::in, label::in, label::out)
Index: compiler/mlds_to_java.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_java.m,v
retrieving revision 1.159
diff -u -b -r1.159 mlds_to_java.m
--- compiler/mlds_to_java.m	15 Jul 2010 01:45:21 -0000	1.159
+++ compiler/mlds_to_java.m	29 Jul 2010 14:55:19 -0000
@@ -2307,10 +2307,9 @@
         mangle_sym_name_for_java(SymName, convert_qual_kind(QualKind),
             ".", ModuleName),
         io.format("%s.%s", [s(ModuleName), s(Name)], !IO),
-        %
-        % Check if the interface is one of the ones in the runtime
-        % system.  If it is we don't need to output the arity.
-        %
+
+        % Check if the interface is one of the ones in the runtime system.
+        % If it is, we don't need to output the arity.
         ( interface_is_special(Name) ->
             true
         ;
Index: compiler/optimize.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/optimize.m,v
retrieving revision 1.67
diff -u -b -r1.67 optimize.m
--- compiler/optimize.m	14 Oct 2009 05:28:41 -0000	1.67
+++ compiler/optimize.m	29 Jul 2010 14:50:02 -0000
@@ -92,14 +92,18 @@
         ;
             set.init(LayoutLabelSet)
         ),
+        Statistics = Info ^ lopt_detailed_statistics,
         optimize_initial(Info, LayoutLabelSet, ProcLabel, CodeModel,
             MayAlterRtti, !C, !OptDebugInfo, !Instrs, !IO),
         optimize_repeat(Info, Repeat, LayoutLabelSet, ProcLabel,
             MayAlterRtti, !C, !OptDebugInfo, !Instrs, !IO),
+        maybe_report_stats(Statistics, !IO),
         optimize_middle(Info, yes, LayoutLabelSet, ProcLabel, CodeModel,
             MayAlterRtti, !C, !OptDebugInfo, !Instrs, !IO),
+        maybe_report_stats(Statistics, !IO),
         optimize_last(Info, LayoutLabelSet, ProcLabel, !C, !.OptDebugInfo,
             !Instrs, !IO),
+        maybe_report_stats(Statistics, !IO),
         CProc = c_procedure(Name, Arity, PredProcId, CodeModel, !.Instrs,
             ProcLabel, !.C, MayAlterRtti, CGlobalVars)
     ).
@@ -470,6 +474,9 @@
         ),
         maybe_opt_debug(Info, !.Instrs, !.C, "frame", "after frame opt",
             ProcLabel, !OptDebugInfo, !IO),
+        Statistics = Info ^ lopt_detailed_statistics,
+        maybe_report_stats(Statistics, !IO),
+
         OptFullJump = Info ^ lopt_opt_fulljumps,
         PessimizeTailCalls = Info ^ lopt_pes_tailcalls,
         CheckedNondetTailCalls = Info ^ lopt_checked_nondet_tailcalls,
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/concurrency
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_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/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/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/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