[m-rev.] for review: tupling transformation

Peter Wang wangp at students.cs.mu.OZ.AU
Wed Mar 2 17:14:07 AEDT 2005


I tried to send this earlier today, but I think it might have been 
rejected due to the size.  I'm sending the diff as a compressed 
attachment this time.  I haven't updated the documentation yet.

Peter


Estimated hours taken: two months
Branches: main

This change adds a tupling transformation to the compiler.  It takes the 
HLDS
and tries to find opportunities for procedures to pass some arguments to 
each
as a tuple rather than as individual arguments.

compiler/interval.m:
compiler/stack_opt.m:
compiler/backend_libs.m:
    Moved the predicate from stack_opt.m that builds up information about
    intervals into a new module backend_libs__interval, and generalised it
    for use by the tupling transformation.  The predicate was called
    `optimize_live_sets_in_goal' and was renamed to
    `build_interval_info_in_goal'.

    Also moved the predicate `record_decisions_in_goal'.

compiler/transform_hlds.m:
compiler/tupling.m:
    New module `tranform_hlds__tupling'.

compiler/mercury_compile.m:
    Added code to run the tupling pass.

    Run a simplification pass after the untupling transformation.  The
    untupling transformation generates procedures that really should be
    simplified, and it should help the tupling transformation (which runs
    directly after untupling).

compiler/options.m:
    Add the options --tuple, --tuple-trace-counts-file,
    --tuple-costs-ratio and --tuple-min-args.

compiler/handle_options.m:
    Disable --tuple when debugging is on.

compiler/hlds_goal.m:
compiler/common.m:
compiler/saved_vars.m
    Add `tuple_opt' goal feature.

compiler/hlds_pred.m:
compiler/layout_out.m:
    Add a new `tuple' functor for `pred_transformation'.

compiler/untupling.m:
    Made the untupling transformation give better names to the head
    variables in the untupled versions of procedures that it generates.
    This is needed for the tupling transformation to find related head
    variables between procedures in an SCC.

mdbcomp/trace_counts.m:
    Add predicate `restrict_trace_counts_to_module'.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tupling.diff.gz
Type: application/x-gunzip
Size: 41844 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20050302/c2b51915/attachment.bin>


More information about the reviews mailing list