Files
mercury/compiler/ll_backend.m
Zoltan Somogyi 68b1a6c0ea Add a new LLDS optimization we discussed on thursday: elimination of procedures
Estimated hours taken: 4
Branches: main

Add a new LLDS optimization we discussed on thursday: elimination of procedures
whose code is an exact copy of the code of another mode of the same predicate.
This happens with in,out vs di,uo and also possibly with in,out vs any,any.
The new optimization reduces the compiler's code size by 0.6%.

compiler/dupproc.m:
	A new module implementing the new optimization.

compiler/ll_backend.m:
	Add dupproc.m as a new submodule.

compiler/notes/compiler_design.html:
	Mention the new module.

compiler/options.m:
	Add an option, --optimize-proc-dups, enabling the new optimization.
	Make --opt-space imply the new option.

doc/user_guide.texi:
	Document the new option.

compiler/mercury_compile.m:
	Invoke the new optimization when compiling by predicates.

	Move the imports of library modules to their own section.

compiler/handle_options.m:
	Make --optimize-proc-dups imply compiling by predicates.

The rest of these changes are cosmetic only.

compiler/llds.m:
	Delete an obsolete form of constant we haven't used in a long time.

compiler/exprn_aux.m:
compiler/jumpopt.m:
compiler/llds_out.m:
compiler/opt_debug.m:
compiler/opt_util.m:
	Conform to the change in llds.m.

compiler/dependency_graph.m:
	Clean up some comments.

compiler/dupelim.m:
	Fix some variable names.

compiler/hlds_module.m:
compiler/hlds_pred.m:
	Minor cleanups.
2005-07-08 04:22:13 +00:00

101 lines
3.1 KiB
Mathematica

%-----------------------------------------------------------------------------%
% Copyright (C) 2002,2003-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.
%-----------------------------------------------------------------------------%
%
% This package contains the low-level back-end
% (a.k.a. the LLDS back-end).
%
:- module ll_backend.
:- interface.
:- import_module aditi_backend. % XXX for rl_file, used in llds_out.
:- import_module hlds.
:- import_module mdbcomp.
:- import_module parse_tree.
%-----------------------------------------------------------------------------%
% Pre-passes to transform or annotate the HLDS
:- include_module deep_profiling. % transform
:- include_module saved_vars. % transform
:- include_module stack_opt. % transform
:- include_module follow_code. % transform
:- include_module liveness. % annotate
:- include_module stack_alloc. % annotate
:- include_module live_vars. % annotate
:- include_module follow_vars. % annotate
:- include_module store_alloc. % annotate
% The llds data structure itself
:- include_module llds.
:- include_module code_util.
% The HLDS->LLDS code generator.
:- include_module code_gen.
:- include_module ite_gen.
:- include_module call_gen.
:- include_module disj_gen.
:- include_module unify_gen.
:- include_module commit_gen.
:- include_module switch_gen.
:- include_module dense_switch.
:- include_module lookup_switch.
:- include_module string_switch.
:- include_module tag_switch.
:- include_module pragma_c_gen.
:- include_module par_conj_gen.
:- include_module middle_rec.
:- include_module trace.
:- include_module code_info.
:- include_module exprn_aux.
:- include_module code_aux.
:- include_module continuation_info.
:- include_module var_locn.
% An alternative HLDS->LLDS code generator for fact tables.
:- include_module fact_table.
%:- module llds_data.
:- include_module ll_pseudo_type_info.
:- include_module layout.
:- include_module stack_layout.
:- include_module prog_rep.
:- include_module global_data.
%:- end_module llds_data.
% LLDS->LLDS optimization passes.
:- include_module optimize.
:- include_module jumpopt.
:- include_module dupelim.
:- include_module dupproc.
:- include_module frameopt.
:- include_module delay_slot.
:- include_module labelopt.
:- include_module peephole.
:- include_module use_local_vars.
:- include_module wrap_blocks.
:- include_module livemap.
:- include_module reassign.
:- include_module basic_block.
:- include_module opt_util.
:- include_module opt_debug.
% The LLDS->C output phase.
:- include_module transform_llds.
:- include_module llds_out.
:- include_module layout_out.
:- include_module rtti_out.
:- implementation.
:- import_module check_hlds. % needed for type_util, mode_util etc
:- import_module backend_libs.
:- import_module libs.
:- end_module ll_backend.
%-----------------------------------------------------------------------------%