[m-rev.] diff: post-commit review of some of Paul's latest changes

Zoltan Somogyi zs at csse.unimelb.edu.au
Tue Sep 30 15:39:30 AEST 2008


Post-commit review of some of Paul's latest changes.

mdbcomp/program_representation.m:
compiler/prog_rep.m:
	Make clear that builtin calls are intended to represent only inline
	builtins. We don't have any out of line builtins, and it is highly
	unlikely that we will ever have them again.

deep_profiler/program_representation_utils.m:
	Don't worry about out of line builtins.

	Fix English in comments.

deep_profiler/mdprog_feedback.m:
	Fix English in several places.

	Construct terms directly, not piece by piece.

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/include
cvs diff: Diffing boehm_gc/include/private
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/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/prog_rep.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_rep.m,v
retrieving revision 1.63
diff -u -b -r1.63 prog_rep.m
--- compiler/prog_rep.m	21 Sep 2008 12:05:06 -0000	1.63
+++ compiler/prog_rep.m	30 Sep 2008 04:36:15 -0000
@@ -356,14 +356,16 @@
                 vars_to_byte_list(Info, Args) ++
                 AtomicBytes
         ;
-            ( Builtin = inline_builtin
-            ; Builtin = out_of_line_builtin
-            ),
+            Builtin = inline_builtin,
             ExprBytes = [goal_type_to_byte(goal_builtin_call)] ++
                 ModuleNameBytes ++
                 PredNameBytes ++
                 vars_to_byte_list(Info, Args) ++
                 AtomicBytes
+        ;
+            Builtin = out_of_line_builtin,
+            unexpected(this_file,
+                "goal_expr_to_byte_list: out_of_line_builtin")
         )
     ;
         GoalExpr = call_foreign_proc(_, _PredId, _, Args, _, _, _),
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
Index: deep_profiler/mdprof_feedback.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/mdprof_feedback.m,v
retrieving revision 1.10
diff -u -b -r1.10 mdprof_feedback.m
--- deep_profiler/mdprof_feedback.m	30 Sep 2008 02:30:51 -0000	1.10
+++ deep_profiler/mdprof_feedback.m	30 Sep 2008 05:16:27 -0000
@@ -83,13 +83,13 @@
             check_options(Options, RequestedFeedbackInfo)
         ->
             lookup_bool_option(Options, verbose, Verbose),
-            read_deep_file(InputFileName, Verbose, MaybeDeepAndProgrep, !IO),
+            read_deep_file(InputFileName, Verbose, MaybeDeepAndProgRep, !IO),
             (
                 ( 
-                    MaybeDeepAndProgrep = deep_and_error(Deep, _ProgrepError)
+                    MaybeDeepAndProgRep = deep_and_error(Deep, _ProgRepError)
                 ; 
-                    % _Progrep will be used bo a later version of this program.
-                    MaybeDeepAndProgrep = deep_and_progrep(Deep, _Progrep)
+                    % _ProgRep will be used by a later version of this program.
+                    MaybeDeepAndProgRep = deep_and_progrep(Deep, _ProgRep)
                 ),
                 feedback.read_or_create(OutputFileName, FeedbackReadResult,
                     !IO),
@@ -120,7 +120,7 @@
                     io.set_exit_status(1, !IO)
                 )
             ;
-                MaybeDeepAndProgrep = error(Error),
+                MaybeDeepAndProgRep = error(Error),
                 io.stderr_stream(Stderr, !IO),
                 io.set_exit_status(1, !IO),
                 io.format(Stderr, "%s: error reading %s: %s\n",
@@ -156,7 +156,7 @@
                 This is stored in the feedback file.
 
     The following options select sets of feedback information useful
-    for particular compiler optimizations.
+    for particular compiler optimizations:
 
     --implicit-parallelism
                 Generate information that the compiler can use for automatic
@@ -176,7 +176,7 @@
                 parallelism, measured on the profiler's call sequence counts.
 
     The following options select specific types of feedback information
-    and parameterise them
+    and parameterise them:
 
     --calls-above-threshold-sorted
                 A list of calls whose typical cost (in call sequence counts) is
@@ -365,7 +365,7 @@
         Options = !.Options
     ),
 
-    % For each feedback type determine if it is requested and fill in the the
+    % For each feedback type, determine if it is requested and fill in the
     % field in the RequestedFeedbackInfo structure.
     lookup_bool_option(Options, calls_above_threshold_sorted,
         CallsAboveThresholdSorted),
@@ -379,19 +379,15 @@
             error("Invalid value for calls_above_threshold_sorted_measure: " ++
                 Measure)
         ),
-        CallsAboveThresholdSortedOpts ^ cats_measure = MeasureType,
         lookup_int_option(Options, implicit_parallelism_proc_cost_threshold,
             CATSThreshold),
-        CallsAboveThresholdSortedOpts ^ cats_threshold = CATSThreshold,
-        MaybeCallsAboveThresholdSortedOpts =
-            yes(CallsAboveThresholdSortedOpts)
+        CallsAboveThresholdSortedOpts =
+            calls_above_threshold_sorted_opts(MeasureType, CATSThreshold),
+        MaybeCallsAboveThresholdSortedOpts = yes(CallsAboveThresholdSortedOpts)
     ;
         CallsAboveThresholdSorted = no,
         MaybeCallsAboveThresholdSortedOpts = no
     ),
-    RequestedFeedbackInfo ^ maybe_calls_above_threshold_sorted =
-        MaybeCallsAboveThresholdSortedOpts,
-    
     lookup_bool_option(Options, candidate_parallel_conjunctions,
         CandidateParallelConjunctions),
     (
@@ -423,8 +419,9 @@
         CandidateParallelConjunctions = no,
         MaybeCandidateParallelConjunctionsOpts = no
     ),
-    RequestedFeedbackInfo ^ maybe_candidate_parallel_conjunctions = 
-        MaybeCandidateParallelConjunctionsOpts.
+    RequestedFeedbackInfo =
+        requested_feedback_info(MaybeCallsAboveThresholdSortedOpts,
+            MaybeCandidateParallelConjunctionsOpts).
 
     % Adjust command line options when one option implies other options.
     %
@@ -438,7 +435,8 @@
         true
     ).
 
-    % Manipulate the option table.
+    % Set the value of an option in the option table.
+    %
 :- pred set_option(option::in, option_data::in,
     option_table(option)::in, option_table(option)::out) is det.
 
Index: deep_profiler/program_representation_utils.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/program_representation_utils.m,v
retrieving revision 1.10
diff -u -b -r1.10 program_representation_utils.m
--- deep_profiler/program_representation_utils.m	28 Sep 2008 11:01:19 -0000	1.10
+++ deep_profiler/program_representation_utils.m	30 Sep 2008 05:17:15 -0000
@@ -562,7 +562,7 @@
                 cri_branch_coverage_points  :: map(goal_path, coverage_point)
             ).
 
-    % Annotate a goal and it's children with coverage information.
+    % Annotate a goal and its children with coverage information.
     %
 :- pred goal_annotate_coverage(coverage_reference_info::in, goal_path::in,
     coverage_info::in, coverage_info::out,
@@ -613,13 +613,9 @@
         GoalExpr0 = atomic_goal_rep(Filename, Line, Vars, AtomicGoal),
         GoalExpr = atomic_goal_rep(Filename, Line, Vars, AtomicGoal),
         (
-            ( AtomicGoal = higher_order_call_rep(_, _)
+            ( AtomicGoal = plain_call_rep(_, _, _)
+            ; AtomicGoal = higher_order_call_rep(_, _)
             ; AtomicGoal = method_call_rep(_, _, _)
-            ; AtomicGoal = plain_call_rep(_, _, _)
-            % While inline builtins don't have call sites out of line builtins
-            % do, and the bytecode representation doesn't distinguish these
-            % types of builtins.
-            ; AtomicGoal = builtin_call_rep(_, _, _)
             ),
             ( map.search(Info ^ cri_call_sites, GoalPath, CallSite) ->
                 Summary = CallSite ^ csf_summary_perf,
@@ -631,22 +627,12 @@
                 Exits = Summary ^ perf_row_exits,
                 !:Coverage = coverage_known(Calls, Exits)
             ;
-                (
-                    % These goal call types must have call sites, whereas some
-                    % builtins and foreign code pragmas may not.
-                    ( AtomicGoal = higher_order_call_rep(_, _)
-                    ; AtomicGoal = method_call_rep(_, _, _)
-                    ; AtomicGoal = plain_call_rep(_, _, _)
-                    )
-                ->
                     error("Couldn't look up call site for port counts GP: " ++
                         goal_path_to_string(GoalPath))
-                ;
-                    propagate_coverage(Detism, GoalPath, !Coverage)
-                )
             )
         ;
-            ( AtomicGoal = unify_construct_rep(_, _, _)
+            ( AtomicGoal = builtin_call_rep(_, _, _)
+            ; AtomicGoal = unify_construct_rep(_, _, _)
             ; AtomicGoal = unify_deconstruct_rep(_, _, _)
             ; AtomicGoal = partial_construct_rep(_, _, _)
             ; AtomicGoal = partial_deconstruct_rep(_, _, _)
@@ -703,7 +689,7 @@
     % Annotate a conjunction with coverage information.
     %
     % The list of goals is the tail of a conjunction, the coverage argument
-    % describes the coverage of this list of goals if it where the entire
+    % describes the coverage of this list of goals if it were the entire
     % conjunction.  Each goal also has it's own coverage.
     %
 :- pred conj_annotate_coverage_2(coverage_reference_info::in, goal_path::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/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
Index: mdbcomp/program_representation.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/program_representation.m,v
retrieving revision 1.40
diff -u -b -r1.40 program_representation.m
--- mdbcomp/program_representation.m	26 Sep 2008 08:47:30 -0000	1.40
+++ mdbcomp/program_representation.m	30 Sep 2008 04:34:39 -0000
@@ -292,6 +292,7 @@
                 list(var_rep)       % the call's arguments
             )
     ;       builtin_call_rep(
+                % This represents inline builtins only.
                 string,             % name of called pred's module
                 string,             % name of the called pred
                 list(var_rep)       % the call's arguments
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/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/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