mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-18 15:26:31 +00:00
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'. library/list.m: Add `nth_member_lookup/3', a deterministic version of `nth_member_search/3'.
44 lines
1.3 KiB
Mathematica
44 lines
1.3 KiB
Mathematica
%-----------------------------------------------------------------------------%
|
|
% Copyright (C) 2002-2005 The University of Melbourne.
|
|
% This file may only be copied under the terms of the GNU General
|
|
% Public License - see the file COPYING in the Mercury distribution.
|
|
%-----------------------------------------------------------------------------%
|
|
%
|
|
% Back-end libraries.
|
|
%
|
|
% This package contains utility modules that are each used by
|
|
% several different back-ends.
|
|
%
|
|
:- module backend_libs.
|
|
:- interface.
|
|
:- import_module hlds.
|
|
:- import_module parse_tree.
|
|
|
|
% modules that provide functionality used by several different back-ends
|
|
:- include_module base_typeclass_info.
|
|
:- include_module builtin_ops.
|
|
:- include_module bytecode_data.
|
|
:- include_module c_util.
|
|
:- include_module compile_target_code.
|
|
:- include_module export.
|
|
:- include_module foreign.
|
|
:- include_module interval.
|
|
:- include_module matching.
|
|
:- include_module name_mangle.
|
|
:- include_module proc_label.
|
|
:- include_module pseudo_type_info.
|
|
:- include_module rtti.
|
|
:- include_module switch_util.
|
|
:- include_module type_ctor_info.
|
|
:- include_module type_class_info.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module check_hlds. % needed for type_util, mode_util
|
|
:- import_module libs.
|
|
:- import_module mdbcomp.
|
|
|
|
:- end_module backend_libs.
|
|
|
|
%-----------------------------------------------------------------------------%
|