mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-19 07:45:09 +00:00
Estimated hours taken: 900 Branches: main Added loop-invariant hoisting optimization. liveness.m: Improved the debugging output to show HLDS before and after liveness analysis. loop_inv.m: New module containing the implementation of the loop invariant hoisting optimization. mercury_compile.m: Added loop_inv at step 34, moving inlining to step 35. options.m: Added bool option --loop-invariants (default `no'). This optimization is set at -O4. passes_aux.m: Minor changes to support introduction of the loop invariant hoisting optmimization. follow_code.m: Updated to reflect the new interface to passes_aux.m. transform_hlds.m: Added include_module declaration for loop_inv.
60 lines
1.9 KiB
Mathematica
60 lines
1.9 KiB
Mathematica
%-----------------------------------------------------------------------------%
|
|
% Copyright (C) 2002 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.
|
|
%-----------------------------------------------------------------------------%
|
|
%
|
|
% transform_hlds: High-level transformations
|
|
% that are independent of the choice of back-end
|
|
% (the "middle" HLDS pass).
|
|
%
|
|
|
|
:- module transform_hlds.
|
|
:- interface.
|
|
:- import_module check_hlds. % is this needed?
|
|
:- import_module hlds, parse_tree, libs.
|
|
|
|
%-----------------------------------------------------------------------------%
|
|
|
|
:- include_module intermod, trans_opt.
|
|
|
|
:- include_module dependency_graph. % XXX imports llds (for profiling labels)
|
|
|
|
:- include_module table_gen.
|
|
|
|
:- include_module (lambda).
|
|
|
|
:- include_module termination.
|
|
:- include_module term_pass1, term_pass2, term_traversal, term_errors.
|
|
:- include_module term_util.
|
|
:- include_module lp. % this could alternatively go in the `libs' module
|
|
|
|
% Optimizations (HLDS -> HLDS)
|
|
:- include_module higher_order.
|
|
:- include_module inlining.
|
|
:- include_module deforest.
|
|
:- include_module pd_cost, pd_debug, pd_info, pd_term.
|
|
:- include_module pd_util.
|
|
:- include_module delay_construct.
|
|
:- include_module unused_args.
|
|
:- include_module unneeded_code.
|
|
:- include_module accumulator.
|
|
:- include_module goal_store.
|
|
:- include_module dead_proc_elim.
|
|
:- include_module const_prop.
|
|
:- include_module loop_inv.
|
|
|
|
% XXX The following modules are all currently unused.
|
|
:- include_module constraint, transform.
|
|
:- include_module lco.
|
|
|
|
%-----------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
:- import_module ll_backend. % XXX for code_util, code_aux
|
|
:- import_module backend_libs. % XXX for rtti
|
|
|
|
:- end_module transform_hlds.
|
|
|
|
%-----------------------------------------------------------------------------%
|