mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 10:23:46 +00:00
b357a3dadcdf29c8d8ca184d65f7634a1a94de36
46 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5f47a8389b |
Stop using higher order insts as modes.
configure.ac:
Require the installed compiler to support --allow-insts-as-modes
(and therefore its negation).
*/*_FLAGS.in:
Add -no-allow-ho-insts-as-modes as a default option.
compiler/bytecode_data.m:
compiler/deforest.m:
compiler/inst_graph.m:
compiler/introduce_parallelism.m:
compiler/mode_constraint_robdd.m:
compiler/mode_constraints.m:
compiler/mode_robdd.equiv_vars.m:
compiler/mode_robdd.implications.m:
compiler/mode_robdd.tfeirn.m:
compiler/parse_util.m:
compiler/recompilation.version.m:
compiler/set_of_var.m:
compiler/term_constr_fixpoint.m:
deep_profiler/array_util.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/dump.m:
deep_profiler/interface.m:
deep_profiler/program_representation_utils.m:
mdbcomp/program_representation.m:
Add in() wrappers around higher order insts used as modes.
Use simply "in" as the mode of functions with the default mode
and determinism.
Fix a few style issues.
|
||
|
|
06f81f1cf0 |
Add end_module declarations ...
.. to modules which did not yet have them. |
||
|
|
f519e26173 |
Add builtin 64-bit integer types -- Part 1.
Add the new builtin types: int64 and uint64.
Support for these new types will need to be bootstrapped over several changes.
This is the first such change and does the following:
- Extends the compiler to recognise 'int64' and 'uint64' as builtin types.
- Extends the set of builtin arithmetic, bitwise and relational operators
to cover the new types.
- Adds the new internal option '--unboxed-int64s' to the compiler; this will be
used to control whether 64-bit integer types are boxed or not.
- Extends all of the code generators to handle the new types.
- Extends the runtimes to support the new types.
- Adds new modules to the standard library intend to contain basic operations
on the new types. (These are currently empty and not documented.)
There are bunch of limitations marks with "XXX INT64"; these will be lifted in
part 2 of this change. Also, 64-bit integer types are currently always boxed,
again this limitation will be lifted in later changes.
compiler/options.m:
Add the new option --unboxed-int64s.
compiler/prog_type.m:
compiler/prog_data.m:
compiler/builtin_lib_types.m:
Recognise int64 and uint64 as builtin types.
compiler/builtin_ops.m:
Add builtin operations for the new types.
compiler/hlds_data.m:
Add new tag types for the new types.
compiler/ctgc.selector.m:
compiler/dead_proc_elim.m:
compiler/export.m:
compiler/foreign.m:
compiler/goal_util.m:
compiler/higher_order.m:
compiler/hlds_code_util.m:
compiler/hlds_dependency_graph.m:
compiler/hlds_out_pred.m:
compiler/hlds_out_util.m:
compiler/implementation_defined_literals.m:
compiler/inst_check.m:
compiler/mercury_to_mercury.m:
compiler/mode_util.m:
compiler/module_qual.qualify_items.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/parse_tree_to_term.m:
compiler/parse_type_name.m:
compiler/polymorphism.m:
compiler/prog_out.m:
compiler/prog_util.m:
compiler/rbmm.execution_path.m:
compiler/rtti.m:
compiler/table_gen.m:
compiler/type_util.m:
compiler/typecheck.m:
compiler/unify_gen.m:
compiler/unify_proc.m:
compiler/unused_imports.m:
compiler/xml_documentation.m:
Conform to the above changes to the parse tree and HLDS.
compiler/c_util.m:
Support writing out constants of the new types.
compiler/llds.m:
Add a representation for constants of the new types to the LLDS.
compiler/stack_layout.m:
Add a new field to the stack layout params that records whether
64-bit integers are boxed or not.
compiler/call_gen.:m
compiler/code_info.m:
compiler/disj_gen.m:
compiler/dupproc.m:
compiler/exprn_aux.m:
compiler/global_data.m:
compiler/jumpopt.m:
compiler/llds_out_data.m:
compiler/llds_out_instr.m:
compiler/lookup_switch.m:
compiler/mercury_compile_llds_back_end.m:
compiler/prog_rep.m:
compiler/prog_rep_tables.m:
compiler/var_locn.m b/compiler/var_locn.m:
Support the new types in the LLDS code generator.
compiler/mlds.m:
Support constants of the new types in the MLDS.
compiler/ml_call_gen.m:
compiler/ml_code_util.m:
compiler/ml_global_data.m:
compiler/ml_rename_classes.m:
compiler/ml_top_gen.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/ml_util.m:
compiler/mlds_to_target_util.m:
compiler/rtti_to_mlds.m:
Conform to the above changes to the MLDS.
compiler/mlds_to_c.m:
compiler/mlds_to_cs.m:
compiler/mlds_to_java.m:
Generate the appropriate target code for constants of the new types
and operations involving them.
compiler/bytecode.m:
compiler/bytecode_gen.m:
Handle the new types in the bytecode generator; we just abort if we
encounter them for now.
compiler/elds.m:
compiler/elds_to_erlang.m:
compiler/erl_call_gen.m:
compiler/erl_code_util.m:
compiler/erl_unify_gen.m:
Handle the new types in the Erlang code generator.
library/private_builtin.m:
Add placeholders for the builtin unify and compare operations for
the new types. Since the bootstrapping compiler will not recognise
the new types we give them polymorphic arguments. These can be
replaced after this change has bootstrapped.
Update the Java list of TypeCtorRep constants here.
library/int64.m:
library/uint64.m:
New modules that will eventually contain builtin operations on the new
types.
library/library.m:
library/MODULES_UNDOC:
Do not include the above modules in the library documentation for now.
library/construct.m:
library/erlang_rtti_implementation.m:
library/rtti_implementation.m:
library/table_statistics.m:
deep_profiler/program_representation_utils.m:
mdbcomp/program_representation.m:
Handle the new types.
configure.ac:
runtime/mercury_conf.h.in:
Define the macro MR_BOXED_INT64S. For now it is always defined, support for
unboxed 64-bit integers will be enabled in a later change.
runtime/mercury_dotnet.cs.in:
java/runtime/TypeCtorRep.java:
runtime/mercury_type_info.h:
Update the list of type_ctor reps.
runtime/mercury.h:
runtime/mercury_int.[ch]:
Add macros for int64 / uint64 -> MR_Word conversion, boxing and
unboxing.
Add functions for hashing 64-bit integer types suitable for use
with the tabling mechanism.
runtime/mercury_tabling.[ch]:
Add additional HashTableSlot structs for 64-bit integer types.
Omit the '%' character from the conversion specifiers we pass via
the 'key_format' argument to the macros that generate the table lookup
function. This is so we can use the C99 exact size integer conversion
specifiers (e.g. PRIu64 etc.) directly here.
runtime/mercury_hash_lookup_or_add_body.h:
Add the '%' character that was omitted above to the call to debug_key_msg.
runtime/mercury_memory.h:
Add new builtin allocation sites for boxed 64-bit integer types.
runtime/mercury_builtin_types.[ch]:
runtime/mercury_builitn_types_proc_layouts.h:
runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_ml_expand_body.h:
runtime/mercury_table_type_body.h:
runtime/mercury_tabling_macros.h:
runtime/mercury_tabling_preds.h:
runtime/mercury_term_size.c:
runtime/mercury_unify_compare_body.h:
Add the new builtin types and handle them throughout the runtime.
runtime/Mmakefile:
Add mercury_int.c to the list of .c files.
doc/reference_manual.texi:
Add the new types to the list of reserved type names.
Add the mapping from the new types to their target language types.
These are commented out for now.
|
||
|
|
8a240ba3f0 |
Add builtin 8, 16 and 32 bit integer types -- Part 1.
Add the new builtin types: int8, uint8, int16, uint16, int32 and uint32.
Support for these new types will need to be bootstrapped over several changes.
This is the first such change and does the following:
- Extends the compiler to recognise 'int8', 'uint8', 'int16', 'uint16', 'int32'
and 'uint32' as builtin types.
- Extends the set of builtin arithmetic, bitwise and relational operators to
cover the new types.
- Extends all of the code generators to handle new types. There currently lots
of limitations and placeholders marked by 'XXX FIXED SIZE INT'. These will
be lifted in later changes.
- Extends the runtimes to support the new types.
- Adds new modules to the standard library intended to hold the basic
operations on the new types. (These are currently empty and not documented.)
This change does not introduce the two 64-bit types, 'int64' and 'uint64'.
Their implementation is more complicated and is best left to a separate change.
compiler/prog_type.m:
compiler/prog_data.m:
compiler/builtin_lib_types.m:
Recognise int8, uint8, int16, uint16, int32 and uint32 as builtin types.
Add new type, int_type/0,that enumerates all the possible integer types.
Extend the cons_id/0 type to cover the new types.
compiler/builtin_ops.m:
Parameterize the integer operations in the unary_op/0 and binary_op/0
types by the new int_type/0 type.
Add builtin operations for all the new types.
compiler/hlds_data.m:
Add new tag types for the new types.
compiler/hlds_pred.m:
Parameterize integers in the table_trie_step/0 type.
compiler/ctgc.selector.m:
compiler/dead_proc_elim.m:
compiler/export.m:
compiler/foreign.m:
compiler/goal_util.m:
compiler/higher_order.m:
compiler/hlds_code_util.m:
compiler/hlds_dependency_graph.m:
compiler/hlds_out_pred.m:
compiler/hlds_out_util.m:
compiler/implementation_defined_literals.m:
compiler/inst_check.m:
compiler/mercury_to_mercury.m:
compiler/mode_util.m:
compiler/module_qual.qualify_items.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/parse_tree_out_info.m:
compiler/parse_tree_to_term.m:
compiler/parse_type_name.m:
compiler/polymorphism.m:
compiler/prog_out.m:
compiler/prog_rep.m:
compiler/prog_rep_tables.m:
compiler/prog_util.m:
compiler/rbmm.exection_path.m:
compiler/rtti.m:
compiler/rtti_to_mlds.m:
compiler/switch_util.m:
compiler/table_gen.m:
compiler/type_constraints.m:
compiler/type_ctor_info.m:
compiler/type_util.m:
compiler/typecheck.m:
compiler/unify_gen.m:
compiler/unify_proc.m:
compiler/unused_imports.m:
compiler/xml_documentation.m:
Conform to the above changes to the parse tree and HLDS.
compiler/c_util.m:
Support generating the builtin operations for the new types.
doc/reference_manual.texi:
Add the new types to the list of reserved type names.
Add the mapping from the new types to their target language types.
These are commented out for now.
compiler/llds.m:
Replace the lt_integer/0 and lt_unsigned functors of the llds_type/0,
with a single lt_int/1 functor that is parameterized by the int_type/0
type.
Add a representations for constants of the new types to the LLDS.
compiler/call_gen.m:
compiler/dupproc.m:
compiler/exprn_aux.m:
compiler/global_data.m:
compiler/jumpopt.m:
compiler/llds_out_data.m:
compiler/llds_out_global.m:
compiler/llds_out_instr.m:
compiler/lookup_switch.m:
compiler/middle_rec.m:
compiler/peephole.m:
compiler/pragma_c_gen.m:
compiler/stack_layout.m:
compiler/string_switch.m:
compiler/switch_gen.m:
compiler/tag_switch.m:
compiler/trace_gen.m:
compiler/transform_llds.m:
Support the new types in the LLDS code generator.
compiler/mlds.m:
Support constants of the new types in the MLDS.
compiler/ml_accurate_gc.m:
compiler/ml_call_gen.m:
compiler/ml_code_util.m:
compiler/ml_disj_gen.m:
compiler/ml_foreign_proc_gen.m:
compiler/ml_global_data.m:
compiler/ml_lookup_switch.m:
compiler/ml_simplify_switch.m:
compiler/ml_string_switch.m:
compiler/ml_switch_gen.m:
compiler/ml_tailcall.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/ml_util.m:
compiler/mlds_to_target_util.m:
Conform to the above changes to the MLDS.
compiler/mlds_to_c.m:
compiler/mlds_to_cs.m:
compiler/mlds_to_java.m:
Generate the appropriate target code for constants of the new
types and operations involving them.
compiler/bytecode.m:
compiler/bytecode_gen.m:
Handle the new types in the bytecode generator; we just abort if we
encounter them for now.
compiler/elds.m:
compiler/elds_to_erlang.m:
compiler/erl_call_gen.m:
compiler/erl_code_util.m:
compiler/erl_rtti.m:
compiler/erl_unify_gen.m:
Handle the new types in the Erlang code generator.
library/private_builtin.m:
Add placeholders for the builtin unify and compare operations for
the new types. Since the bootstrapping compiler will not recognise
the new types we give the polymorphic arguments. These can be
replaced after this change has bootstrapped.
Update the Java list of TypeCtorRep constants.
library/int8.m:
library/int16.m:
library/int32.m:
library/uint8.m:
library/uint16.m:
library/uint32.m:
New modules that will eventually contain builtin operations
on the new types.
library/library.m:
library/MODULES_UNDOC:
Do not include the above modules in the library documentation
for now.
library/construct.m:
library/erlang_rtti_implementation.m:
library/rtti_implementation.m:
deep_profiler/program_representation_utils.m:
mdbcomp/program_representation.m:
Handle the new types.
runtime/mercury_dotnet.cs.in:
java/runtime/TypeCtorRep.java:
runtime/mercury_type_info.h:
Update the list of TypeCtorReps.
configure.ac:
runtime/mercury_conf.h.in:
Check for the header stdint.h.
runtime/mercury_std.h:
Include stdint.h; abort if that header is no present.
runtime/mercury_builtin_types.[ch]:
runtime/mercury_builtin_types_proc_layouts.h:
runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_ml_expand_body.h
runtime/mercury_table_type_body.h:
runtime/mercury_tabling_macros.h:
runtime/mercury_tabling_preds.h:
runtime/mercury_term_size.c:
runtime/mercury_unify_compare_body.h:
Add the new builtin types and handle them throughout the runtime.
|
||
|
|
9095985aa8 |
Fix more warnings from --warn-inconsistent-pred-order-clauses.
deep_profiler/*.m:
Fix inconsistencies between (a) the order in which functions and predicates
are declared, and (b) the order in which they are defined.
In most modules, either the order of the declarations or the order
of the definitions made sense, and I changed the other to match.
In some modules, neither made sense, so I changed *both* to an order
that *does* make sense (i.e. it has related predicates together).
In query.m, put the various commands in the same sensible order
as the code processing them.
In html_format.m, merge two exported functions together, since
they can't be used separately.
In some places, put dividers between groups of related
functions/predicates, to make the groups themselves more visible.
In some places, fix comments or programming style.
deep_profiler/DEEP_FLAGS.in:
Since all the modules in this directory are now free from any warnings
generated by --warn-inconsistent-pred-order-clauses, specify that option
by default in this directory to keep it that way.
|
||
|
|
092e175f45 |
Add a builtin unsigned word sized integer type -- Part 1.
Add a new builtin type: uint, which is an unsigned word sized integer type.
Support for this new type will need be bootstrapped over several changes.
This is the first such change and does the following:
- Extends the compiler to recognize 'uint' as a builtin type.
- Extends the set of builtin operations to include relational and (some)
arithmetic operations on uints.
- Extends all of the code generators to handle the above. There are some
limitations currently marked by 'XXX UINT'. These will be lifted once
the compiler recognised uint and additional library support becomes
available.
- Extends the runtime to support uints.
compiler/prog_type.m:
compiler/prog_data.m:
compiler/builtin_lib_types.m:
Recognize uint as a builtin type.
Add a new alternative to the cons_id/0 type corresponding to the uint type
-- for bootstrapping purposes its argument is currently an int.
compiler/builtin_ops.m:
Add builtin relational and arithmetic operations on uints. Note that the
existing 'unsigned_le' operation is actually intended for use with signed
values. Rather than attempt to modify its meaning, I have just added new
operations specific to the uint type.
compiler/hlds_data.m:
Add a new tag type for uints.
compiler/type_ctor_info.m:
Recognise uint as a builtin.
Bump the RTTI version number here.
compiler/ctgc.selector.m:
compiler/dead_proc_elim.m:
compiler/dependency_graph.m:
compiler/export.m:
compiler/foreign.m:
compiler/goal_util.m:
compiler/higher_order.m:
compiler/hlds_code_util.m:
compiler/hlds_out_pred.m:
compiler/hlds_out_util.m:
compiler/hlds_pred.m:
compiler/implementation_defined_literals.m:
compiler/inst_check.m:
compiler/mercury_to_mercury.m:
compiler/mode_util.m:
compiler/module_qual.qualify_items.m:
compiler/parse_tree_to_term.m:
compiler/parse_type_name.m:
compiler/polymorphism.m:
compiler/prog_out.m:
compiler/prog_rep.m:
compiler/prog_rep_tables.m:
compiler/prog_util.m:
compiler/rbmm.execution_path.m:
compiler/rtti.m:
compiler/special_pred.m:
compiler/switch_gen.m:
compiler/switch_util.m:
compiler/table_gen.m:
compiler/type_constraints.m:
compiler/type_util.m:
compiler/typecheck.m:
compiler/unify_gen.m:
compiler/unify_proc.m:
compiler/unused_imports.m:
compiler/write_module_interface_files.m:
compiler/xml_documentation.m:
Conform to the above changes to the parse tree and HLDS.
compiler/c_util.m:
Support generating builtin operations for uints.
compiler/llds.m:
Add a representation for uint constants to the LLDS.
Map uints onto MR_Unsigned.
compiler/call_gen.m:
compiler/dupproc.m:
compiler/exprn_aux.m:
compiler/global_data.m:
compiler/jumpopt.m:
compiler/llds_out_data.m:
compiler/llds_out_instr.m:
compiler/opt_debug.m:
compiler/opt_util.m:
Support uints in the LLDS code generator.
compiler/mlds.m:
Support uint constants in the MLDS.
compiler/ml_accurate_gc.m:
compiler/ml_call_gen.m:
compiler/ml_global_data.m:
compiler/ml_simplify_switch.m:
compiler/ml_switch_gen.m:
compiler/ml_tailcall.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/ml_util.m:
compiler/rtti_to_mlds.m:
Conform to the above change to the MLDS.
compiler/mlds_to_c.m:
compiler/mlds_to_java.m:
compiler/mlds_to_cs.m:
Generate the appropriate target code for uint constants and uint
relational operations.
compiler/bytecode.m:
compiler/bytecode_gen.m:
Handle uints in the bytecode generator: we just abort if we
encounter them for now.
compiler/elds.m:
compiler/elds_to_erlang.m:
compiler/erl_call_gen.m:
compiler/erl_code_util.m:
compiler/erl_rtti.m:
compiler/erl_unify_gen.m:
Handle uints in the Erlang code generator.
library/private_builtin.m:
Add placeholders for builtin_{unify,compare}_uint. Since the
bootstrapping compiler will not recognize uint as a type, we
give them polymorphic arguments. These can be replaced after
this change has bootstrapped.
Update the Java list of TypeCtorRep constants, which for some
reason is defined here.
library/uint.m:
New module that will eventually contain operations on uints.
library/MODULES_DOCS:
library/library.m:
Add the uint module.
library/construct.m:
library/erlang_rtti_implementation.m:
library/rtti_implementation.m:
mdbcomp/program_representation.m:
Handle uints.
deep_profiler/program_representation_utils.m:
Conform to the above change.
runtime/mercury_dotnet.cs.in:
Update the list of TypeCtorReps for C#
java/runtime/TypeCtorRep.java:
Update this, although the actual TypeCtorRep constants
are defined the library.
runtime/mercury_type_info.h:
Bump the RTTI version number.
Add an alternative for uints to the tyepctor rep enum.
runtime/mercury_builtin_types.{h,c}:
runtime/mercury_builtin_types_proc_layouts.h:
runtime/mercury_deconstruct.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_table_type_body.h:
runtime/mercury_tabling.h:
runtime/mercury_tabling_macros.h:
runtime/mercury_unify_compare_body.h:
Add uint as a builtin type and handle it throughout the runtime.
runtime/mercury_grade.h:
Bump the binary compatibility version.
runtime/mercury_term_size.c:
runtime/mercury_ml_expand_body.h:
Handle uint and fix probable bugs with the handling of ints on
64-bit Windows.
|
||
|
|
a0760327b6 |
Do stricter checking of mode and determinism declarations.
Specifically, we now do three new checks:
BAD_DETISM: We now generate error messages for predicate declarations
that specify a determinism without also specifying argument modes.
BAD_PREDMODE: We now generate error messages for standalone mode declarations
for predicates whose predicate declaration includes modes for the arguments.
BAD_MODE_SECTION: We now generate error messages for standalone mode
declarations that are not in the same section as the predicate's (or
function's) type declaration.
compiler/hlds_pred.m:
Add a slot to the pred_sub_info. If the predicate is explicitly defined by
the user in the current module, this contains the id of the section that
contains its predicate declaration (for the BAD_MODE_SECTION check)
and whether that predicate declaration also had modes for the arguments
(for the BAD_PREDMODE check).
compiler/add_pred.m:
When adding adding new predicate declarations, perform the BAD_DETISM
check, and record the info needed for the BAD_PREDMODE and BAD_MODE_SECTION
checks.
When adding adding new mode declarations, perform the BAD_PREDMODE
and BAD_MODE_SECTION checks.
compiler/add_class.m:
compiler/add_mutable_aux_preds.m:
compiler/add_pragma_tabling.m:
compiler/add_pragma_type_spec.m:
compiler/add_solver.m:
compiler/add_special_pred.m:
compiler/check_typeclass.m:
compiler/dep_par_conj.m:
compiler/higher_order.m:
compiler/make_hlds_passes.m:
compiler/table_gen.m:
compiler/unused_args.m:
Conform to the changes above.
mdbcomp/builtin_modules.m:
Add a utility predicate for use by new code in add_pred.m.
compiler/comp_unit_interface.m:
compiler/goal_util.m:
compiler/prog_rename.m:
compiler/quantification.m:
deep_profiler/program_representation_utils.m:
library/calendar.m:
library/mutvar.m:
library/pretty_printer.m:
library/random.m:
library/set_ctree234.m:
library/solutions.m:
library/stream.string_writer.m:
profiler/globals.m:
tests/accumulator/nonrec.m:
tests/accumulator/out_to_in.m:
tests/declarative_debugging/library_forwarding.m:
tests/dppd/applast_impl.m:
tests/dppd/grammar_impl.m:
tests/dppd/regexp.m:
tests/dppd/transpose_impl.m:
tests/hard_coded/copy_pred.m:
tests/hard_coded/ho_func_default_inst.m:
tests/recompilation/unchanged_pred_nr_2.m.1:
tests/recompilation/unchanged_pred_nr_2.m.2:
tests/valid/det_switch.m:
tests/valid/inlining_bug.m:
Delete determinism declarations from predicate and function declarations
that have no argument mode information, since the BAD_DETISM check
now makes these errors.
tests/valid/two_pragma_c_codes.m:
Move some mode declarations to the right section, since the
BAD_MODE_SECTION check now generates an error for the old code.
tests/invalid/typeclass_bad_method_mode.{m,err_exp}:
New test case to test for the BAD_PREDMODE check.
tests/invalid/mode_decl_in_wrong_section.{m,err_exp}:
New test case to test for the BAD_MODE_SECTION check.
tests/invalid/bad_detism.err_exp:
Add an expected output for this old, but never enabled test case,
which tests for new check BAD_DETISM.
tests/invalid/Mmakefile:
Enable the new test cases.
tests/invalid/typeclass_dup_method_mode.m:
This test case used to have two bugs. One is now by itself in the new
typeclass_bad_method_mode.m test case, so modify it to contain only
the other (indistinguishable modes).
tests/invalid/func_errors.err_exp:
tests/invalid/tc_err1.err_exp:
tests/invalid/undef_lambda_mode.err_exp:
tests/invalid/undef_type_mode_qual.err_exp:
Expect an extra error message from the BAD_DETISM check.
|
||
|
|
270170416d |
Bring the style of deep_profiler/* up-to-date.
deep_profiler/*.m:
Replace ( C -> T ; E ) if-then-elses with (if C then T else E ).
Replace calls to error/1 with calls to unexpected/3.
Add some module qualifications where this makes the code easier to read.
|
||
|
|
500948d549 |
Break up mdbcomp/prim_data.m. The new modules have much better cohesion.
mdbcomp/sym_name.m:
New module, containing the part of the old prim_data.m that
dealt with sym_names.
mdbcomp/builtin_modules.m:
New module, containing the part of the old prim_data.m that
dealt with builtin modules.
mdbcomp/prim_data.m:
Remove the things that are now in the two new modules.
mdbcomp/mdbcomp.m:
deep_proiler/Mmakefile:
slice/Mmakefile:
Add the two new modules.
browser/*.m:
compiler/*.m:
deep_proiler/*.m:
mdbcomp/*.m:
slice/*.m:
Conform to the above changes.
|
||
|
|
2d0bfc0674 |
The algorithm that decides whether the order independent state update
Estimated hours taken: 120 Branches: main The algorithm that decides whether the order independent state update transformation is applicable in a given module needs access to the list of oisu pragmas in that module, and to information about the types of variables in the procedures named in those pragmas. This diff puts this information in Deep.procrep files, to make them available to the autoparallelization feedback program, to which that algorithm will later be added. Compilers that have this diff will generate Deep.procrep files in a new, slightly different format, but the deep profiler will be able to read Deep.procrep files not just in the new format, but in the old format as well. runtime/mercury_stack_layout.h: Add to module layout structures the fields holding the new information we want to put into Deep.procrep files. This means three things: - a bytecode array in module layout structures encoding the list of oisu pragmas in the module; - additions to the bytecode arrays in procedure layout structures mapping the procedure's variables to their types; and - a bytecode array containing the encoded versions of those types themselves in the module layout structure. This allows us to represent each type used in the module just once. Since there is now information in module layout structures that is needed only for deep profiling, as well as information that is needed only for debugging, the old arrangement that split a module's information between two structures, MR_ModuleLayout (debug specific info) and MR_ModuleCommonLayout (info used by both debugging and profiling), is no longer approriate. We could add a third structure containing profiling-specific info, but it is simpler to move all the info into just one structure, some of whose fields may not be used. This wastes only a few words of memory per module, but allows the runtime system to avoid unnecessary indirections. runtime/mercury_types.h: Remove the type synonym for the deleted type. runtime/mercury_grade.h: The change in mercury_stack_layout.h destroys binary compatibility with previous versions of Mercury for debug and deep profiling grades, so bump their grade-component-specific version numbers. runtime/mercury_deep_profiling.c: Write out the information in the new fields in module layout structures, if they are filled in. Since this changes the format of the Deep.procrep file, bump its version number. runtime/mercury_deep_profiling.h: runtime/mercury_stack_layout.c: Conform to the change to mercury_stack_layout.h. mdbcomp/program_representation.m: Add to module representations information about the oisu pragmas defined in that module, and the type table of the module. Optionally add to procedure representations a map mapping the variables of the procedure to their types. Rename the old var_table type to be the var_name_table type, since it contains just names. Make the var to type map separate, since it will be there only for selected procedures. Modify the predicates reading in module and procedure representations to allow them to read in the new representation, while still accepting the old one. Use the version number in the Deep.procrep file to decide which format to expect. mdbcomp/rtti_access.m: Add functions to encode the data representations that this module also decodes. Conform to the changes above. mdbcomp/feedback.automatic_parallelism.m: Conform the changes above. mdbcomp/prim_data.m: Fix layout. compiler/layout.m: Update the compiler's representation of layout structures to conform to the change to runtime/mercury_stack_layout.h. compiler/layout_out.m: Output the new parts of module layout structures. compiler/opt_debug.m: Allow the debugging of code referring to the new parts of module layout structures. compiler/llds_out_file.m: Conform to the move to a single module layout structure. compiler/prog_rep_tables.m: This new module provided mechanisms for building the string table and the type table components of module layouts. The string table part is old (it is moved here from stack_layout.m); the type table part is new. Putting this code in a module of its own allows us to remove a circular dependency between prog_rep.m and stack_layout.m; instead, both now just depend on prog_rep_tables.m. compiler/ll_backend.m: Add the new module. compiler/notes/compiler_design.html: Describe the new module. compiler/prog_rep.m: When generating the representation of a module for deep profiling, include the information needed by the order independent state update analysis: the list of oisu pragmas in the module, if any, and information about the types of variables in selected procedures. To avoid having these additions increasing the size of the bytecode representation too much, convert some fixed 32 bit numbers in the bytecode to use variable sized numbers, which will usually be 8 or 16 bits. Do not use predicates from bytecode_gen.m to encode numbers, since there is nothing keeping these in sync with the code that reads them in mdbcomp/program_representation.m. Instead, use new predicates in program_representation.m itself. compiler/stack_layout.m: Generate the new parts of module layouts. Remove the code moved to prog_rep_tables.m. compiler/continuation_info.m: compiler/proc_gen.m: Make some more information available to stack_layout.m. compiler/prog_data.m: Fix some formatting. compiler/introduce_parallelism.m: Conform to the renaming of the var_table type. compiler/follow_code.m: Fix the bug that used to cause the failure of the hard_coded/mode_check_clauses test case in deep profiling grades. deep_profiler/program_representation_utils.m: Output the new parts of module and procedure representations, to allow the correctness of this change to be tested. deep_profiler/mdprof_create_feedback.m: If we cannot read the Deep.procrep file, print a single error message and exit, instead of continuing with an analysis that will generate a whole bunch of error messages, one for each attempt to access a procedure's representation. deep_profiler/mdprof_procrep.m: Give this program an option that specifies what file it is to look at; do not hardwire in "Deep.procrep" in the current directory. deep_profiler/report.m: Add a report type that just prints the representation of a module. It returns the same information as mdprof_procrep, but from within the deep profiler, which can be more convenient. deep_profiler/create_report.m: deep_profiler/display_report.m: Respectively create and display the new report type. deep_profiler/query.m: Recognize a query asking for the new report type. deep_profiler/autopar_calc_overlap.m: deep_profiler/autopar_find_best_par.m: deep_profiler/autopar_reports.m: deep_profiler/autopar_search_callgraph.m: deep_profiler/autopar_search_goals.m: deep_profiler/autopar_types.m: deep_profiler/branch_and_bound.m: deep_profiler/coverage.m: deep_profiler/display.m: deep_profiler/html_format.m: deep_profiler/mdprof_test.m: deep_profiler/measurements.m: deep_profiler/query.m: deep_profiler/read_profile.m: deep_profiler/recursion_patterns.m: deep_profiler/top_procs.m: deep_profiler/top_procs.m: Conform to the changes above. Fix layout. tests/debugger/declarative/dependency.exp2: Add this file as a possible expected output. It contains the new field added to module representations. |
||
|
|
d013a4cfcf |
Change the types that represent forward and reverse goal paths from being
Estimated hours taken: 20 Branches: main Change the types that represent forward and reverse goal paths from being wrappers around lists of steps, to being full discriminated union types. This is meant to accomplish two objectives. First, since taking the wrappers off and putting them back on is inconvenient, code often dealt with naked lists of steps, with the meaning of those steps sometimes being unclear. Second, in a future change I intend to change the way the debugger represents goal paths from being strings to being statically allocated terms of the reverse_goal_path type. This should have two benefits. One is reduced memory consumption, since two different goal path strings cannot share memory but two different reverse goal paths can share the memory containing their common tail (the goal paths steps near the root). The other is that the declarative debugger won't need to do any conversion from string to structure, and should therefore be faster. Having the compiler generate static terms of the reverse_goal_path type into the .c files it generates for every Mercury program being compiled with debugging requires it to have access to the definition of that type and all its components. The best way to do this is to put all those types into a new builtin module in the library (a debugging equivalent of e.g. profiling_builtin.m). We cannot put the definition of the list type into that module without causing considerable backward incompatibilities. mdbcomp/mdbcomp.goal_path.m: Make the change described above. Add some more predicates implementing abstract operations on goal paths. browser/declarative_tree.m: compiler/goal_path.m: compiler/goal_util.m: compiler/hlds_goal.m: compiler/introduce_parallelism.m: compiler/mode_ordering.m: compiler/push_goals_together.m: compiler/rbmm.condition_renaming.m: compiler/trace_gen.m: compiler/tupling.m: compiler/unneeded_code.m: deep_profiler/autopar_costs.m: deep_profiler/autopar_reports.m: deep_profiler/autopar_search_callgraph.m: deep_profiler/autopar_search_goals.m: deep_profiler/create_report.m: deep_profiler/message.m: deep_profiler/program_representation_utils.m: deep_profiler/read_profile.m: deep_profiler/recursion_patterns.m: deep_profiler/var_use_analysis.m: Conform to the change in representation. In some cases, remove predicates whose only job was to manipulate wrappers. In others, replace concrete operations on lists of steps with abstract operations on goal paths. compiler/mode_constraints.m: Comment out some code that I do not understand, which I think never worked (not surprising, since the whole module has never been operational). mdbcomp/slice_and_dice.m: Since this diff changes the types representing goal paths, it also changes their default ordering, as implemented by builtin.compare. When ordering slices and dices by goal paths, make the ordering explicitly work on the forward goal path, since ordering by the reverse goal path (the actual data being used) gives nonintuitive results. library/list.m: Speed up some code. mdbcomp/feedback.automatic_parallelism.m: Fix some formatting. |
||
|
|
9ae7fe6b70 |
Change the argument ordering of predicates in the set module.
Branches: main Change the argument ordering of predicates in the set module. library/set.m: Change predicate argument orders to match the versions in the svset module. Group function definitions with the corresponding predicates rather than at the end of the file. Delete Ralph's comments regarding the argument order in the module interface: readers of the library reference guide are unlikely to be interested in his opinion of the argument ordering ten or so years ago. Add extra modes for set.map/3 and set.map_fold/5. library/svset.m: library/eqvclass.m: library/tree234.m: library/varset.m: browser/*.m: compiler/*.m: deep_profiler/*.m: mdbcomp/trace_counts.m: extras/moose/grammar.m: extras/moose/lalr.m: extras/moose/moose.m: tests/hard_coded/bitset_tester.m: Conform to the above change. NEWS: Announce the above changes. |
||
|
|
9f68c330f0 |
Change the argument order of many of the predicates in the map, bimap, and
Branches: main
Change the argument order of many of the predicates in the map, bimap, and
multi_map modules so they are more conducive to the use of state variable
notation, i.e. make the order the same as in the sv* modules.
Prepare for the deprecation of the sv{bimap,map,multi_map} modules by
removing their use throughout the system.
library/bimap.m:
library/map.m:
library/multi_map.m:
As above.
NEWS:
Announce the change.
Separate out the "highlights" from the "detailed listing" for
the post-11.01 NEWS.
Reorganise the announcement of the Unicode support.
benchmarks/*/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
extras/*/*.m:
mdbcomp/*.m:
profiler/*.m:
tests/*/*.m:
ssdb/*.m:
samples/*/*.m
slice/*.m:
Conform to the above change.
Remove any dependencies on the sv{bimap,map,multi_map} modules.
|
||
|
|
59b0edacbe |
New module for calculating the overlap between the conjuncts of a
Estimated hours taken: 2 deep_profiler/autopar_calc_overlap.m: New module for calculating the overlap between the conjuncts of a parallelised conjunction. Its contents are taken from the old autopar_search_callgraph.m. deep_profiler/autopar_costs.m: New module for calculating the costs of goals. Its contents are taken from the old autopar_search_callgraph.m. deep_profiler/autopar_reports.m: New module for creating reports. Its contents are taken from the old autopar_search_callgraph.m. deep_profiler/autopar_search_goals.m: New module for searching goals for parallelizable conjunctions. Its contents are taken from the old autopar_search_callgraph.m. deep_profiler/autopar_search_callgraph.m: Remove the code moved to other modules. deep_profiler/mdprof_fb.automatic_parallelism.m: Add the new modules. deep_profiler/*.m: Remove unnecessary imports. Fix copyright years on the new modules. browser/*.m: compiler/*.m: mdbcomp/*.m: Remove unnecessary imports. library/Mercury.options: Make it possible to compile a whole workspace with --warn-unused-imports by turning that option off for type_desc.m (which has a necessary import that --warn-unused-imports thinks is unused). |
||
|
|
e33ce09de3 |
These problems wern't noticed until I tried to parallelise larger examples.
Fix a few places where the recursion probability anlaysis and variable use
analysis can divide by zero.
var_use_analysis.m:
As above.
The wrong goal path step is used for disjunctions when labeling goals. I think
Zoltan reported this earlier but I thought that he fixed it.
deep_profiler/program_representation_utils.m:
As above.
In some cases the HLDS does not match the feedback data, from this example in
benchmarks/progs/pic:
chargeDensity(particle_heap(Xypos,_)) =
accum_mesh((+), 0.0, N, N, accumCharge(Xypos)) :-
N = nCell - 1.
nCall and 1 are constants and are known at compile time (nCall via inter-module
analysis) In the feedback data this expression has been elimiated and replaced
with a constant however at this stage in the HLDS this hasn't happened. The
change below inserts a simplification pass before the implicit parallelism
transformation.
compiler/options.m:
Add a new option pre_implicit_parallelism_simplify
compiler/handle_options.m:
implicit-parallelism implies pre_implicit_parallelism_simplify.
compiler/mercury_compile_front_end.m:
Add the new constructor symbol for the new simplification pass.
Configure the set of simplifications for the pre implicit parallelism
simplificaiton pass.
compiler/mercury_compile_middle_passes.m:
Run the new simplfication pass immediatly before implicit parallelism.
Re-order the middle-end passes so that implicit parallelism is applied
after many optimisations such as inlining.
|
||
|
|
2070f42b24 |
Refactor goal annotations in the deep profiler.
Goal annotations have previously been attached to goals using type-polymorphism
and in some cases type classes. This has become clumsy as new annotations are
created. Using the goal_id code introduced recently, this change associates
annotations with goals by storing them in an array indexed by goal ids. Many
analyses have been updated to make use of this code. This code should also be
faster as less allocation is done when annotating a goal as the goal
representation does not have to be reconstructed.
mdbcomp/mdbcomp.goal_path.m:
Add predicates for working with goal attribute arrays. These are
polymorphic arrays that are indexed by goal id and can be used to associate
information with goals.
deep_profiler/report.m:
The procrep coverage info report now stores the coverage annotations in a
goal_attr_array.
deep_profiler/coverage.m:
The coverage analysis now returns its result in a goal_attr_array rather
than by annotation the goal directly.
The interface for the coverage module has changed, it now allows
programmers to pass a goal_rep to it directly. This makes it easier to
call from other analyses.
The coverage analysis no longer uses the calls_and_exits structure.
Instead it uses the cost_and_callees structure like many other analyses.
This also makes it easier to perform this annotation and others using only
a single call site map structure.
Moved add_coverage_point_to_map/5 from create_report.m to coverage.m.
deep_profiler/analysis_utils.m:
Made cost_and_callees structure polymorphic so that any type can be used to
represent the callees. (So that either static or dynamic callees can be
used).
Added the number of exit port counts to the cost_and_callees structure.
Added build_static_call_site_cost_and_callees_map/4.
Rename build_call_site_cost_and_callees_map/4 to
build_dynamic_call_site_cost_and_callees_map/4.
deep_profiler/var_use_analysis.m:
Update the var_use_analysis to use coverage information provided in a
goal_attr_array.
deep_profiler/recursion_patterns.m:
Update the recursion analysis to use coverage information provided in a
goal_attr_array.
deep_profiler/program_representation_utils.m:
Add label_goals/4 to label goals with goal ids and build a map of goal ids
to goal paths.
Update pretty printing fucntions to work with either annotation on the
goals themselves or provided by a higher order value. The higher order
argument maps nicly to the function goal_get_attribute/3 in goal_path.m
deep_profiler/mdprof_fb.automatic_parallelism.m:
Modify goal_annotate_with_instmap, it now returns the instmap annotations
in a goal_attr_array.
Conform to changes in:
program_representation_utils.m
coverage.m
var_use_analysis.m
deep_profiler/message.m:
Updated messagee to more correctly express the problems that
mdprof_fb.automatic_parallelism.m may encounter.
deep_profiler/create_report.m:
Conform to changes in coverage.m.
Make use of code in analysis_utils.m to prepare call site maps for coverage
analysis.
deep_profiler/recursion_patterns.m:
deep_profiler/var_use_analysis.m:
Conform to changes in analysis_utils.m.
deep_profiler/display_report.m:
Conform to changes in program_representation_utils.m.
|
||
|
|
d43239d6a7 |
Move some of the goal path code from compiler/goal_path.m to the mdbcomp
library where it can be used by the deep profiler.
Also move the goal path code from program_representation.m to the new module,
goal_path.m in mdbcomp/
mdbcomp/goal_path.m:
New module containing goal path code.
mdbcomp/program_representation.m:
Original location of goal path code.
compiler/goal_path.m:
Move some of this goal_path code into mdbcomp/goal_path.m
mdbcomp/feedback.automatic_parallelisation.m:
mdbcomp/rtti_access.m:
mdbcomp/slice_and_dice.m:
mdbcomp/trace_counts.m:
browser/debugger_interface.m:
browser/declarative_execution.m:
browser/declarative_tree.m:
compiler/build_mode_constraints.m:
compiler/call_gen.m:
compiler/code_info.m:
compiler/continuation_info.m:
compiler/coverage_profiling.m:
compiler/deep_profiling.m:
compiler/format_call.m:
compiler/goal_path.m:
compiler/goal_util.m:
compiler/hlds_data.m:
compiler/hlds_goal.m:
compiler/hlds_out_goal.m:
compiler/hlds_out_pred.m:
compiler/hlds_pred.m:
compiler/interval.m:
compiler/introduce_parallelism.m:
compiler/layout_out.m:
compiler/llds.m:
compiler/mode_constraint_robdd.m:
compiler/mode_constraints.m:
compiler/mode_ordering.m:
compiler/ordering_mode_constraints.m:
compiler/polymorphism.m:
compiler/post_typecheck.m:
compiler/prog_rep.m:
compiler/prop_mode_constraints.m:
compiler/push_goals_together.m:
compiler/rbmm.condition_renaming.m:
compiler/smm_common.m:
compiler/stack_layout.m:
compiler/stack_opt.m:
compiler/trace_gen.m:
compiler/tupling.m:
compiler/type_constraints.m:
compiler/typecheck.m:
compiler/unify_gen.m:
compiler/unneeded_code.m:
deep_profiler/Mmakefile:
deep_profiler/analysis_utils.m:
deep_profiler/coverage.m:
deep_profiler/create_report.m:
deep_profiler/display_report.m:
deep_profiler/dump.m:
deep_profiler/mdprof_fb.automatic_parallelism.m:
deep_profiler/message.m:
deep_profiler/old_query.m:
deep_profiler/profile.m:
deep_profiler/program_representation_utils.m:
deep_profiler/read_profile.m:
deep_profiler/recursion_patterns.m:
deep_profiler/report.m:
deep_profiler/var_use_analysis.m:
slice/Mmakefile:
slice/mcov.m:
Conform to the move of the goal path code.
|
||
|
|
a2cd0da5b3 |
The existing representation of goal_paths is suboptimal for several reasons.
Estimated hours taken: 80 Branches: main The existing representation of goal_paths is suboptimal for several reasons. - Sometimes we need forward goal paths (e.g. to look up goals), and sometimes we need reverse goal paths (e.g. when computing goal paths in the first place). We had two types for them, but - their names, goal_path and goal_path_consable, were not expressive, and - we could store only one of them in goal_infos. - Testing whether goal A is a subgoal of goal B is quite error-prone using either form of goal paths. - Using a goal path as a key in a map, which several compiler passes want to do, requires lots of expensive comparisons. This diff replaces most uses of goal paths with goal ids. A goal id is an integer, so it can be used as a key in faster maps, or even in arrays. Every goal in the body of a procedure gets its id allocated in a depth first search. Since we process each goal before we dive into is descendants, the goal representing the whole body of a procedure always gets goal id 0. The depth first traversal also builds up a map (the containing goal map) that tells us the parent goal of ever subgoal, with the obvious exception of the root goal itself. From the containing goal map, one can compute both reverse and forward goal paths. It can also serve as the basis of an efficient test of whether the goal identified by goal id A is an ancestor of another goal identified by goal id B. We don't yet use this test, but I expect we will in the future. mdbcomp/program_representation.m: Add the goal_id type. Replace the existing goal_path and goal_path_consable types with two new types, forward_goal_path and reverse_goal_path. Since these now have wrappers around the list of goal path steps that identify each kind of goal path, it is now ok to expose their representations. This makes several compiler passes easier to code. Update the set of operations on goal paths to work on the new data structures. Add a couple of step types to represent lambdas and try goals. Their omission prior to this would have been a bug for constraint-based mode analysis, or any other compiler pass prior to the expansion out of lambda and try goals that wanted to use goal paths to identify subgoals. browser/declarative_tree.m: mdbcomp/rtti_access.m: mdbcomp/slice_and_dice.m: mdbcomp/trace_counts.m: slice/mcov.m: deep_profiler/*.m: Conform to the changes in goal path representation. compiler/hlds_goal: Replace the goal_path field with a goal_id field in the goal_info, indicating that from now on, this should be used to identify goals. Keep a reverse_goal_path field in the goal_info for use by RBMM and CTGC. Those analyses were too hard to convert to using goal_ids, especially since RBMM uses goal_paths to identify goals in multi-pass algorithms that should be one-pass and should not NEED to identify any goals for later processing. compiler/goal_path: Add predicates to fill in goal_ids, and update the predicates filling in the now deprecated reverse goal path fields. Add the operations needed by the rest of the compiler on goal ids and containing goal maps. Remove the option to set goal paths using "mode equivalent steps". Constraint based mode analysis now uses goal ids, and can now do its own equivalent optimization quite simply. Move the goal_path module from the check_hlds package to the hlds package. compiler/*.m: Conform to the changes in goal path representation. Most modules now use goal_ids to identify goals, and use a containing goal map to convert the goal ids to goal paths when needed. However, the ctgc and rbmm modules still use (reverse) goal paths. library/digraph.m: library/group.m: library/injection.m: library/pprint.m: library/pretty_printer.m: library/term_to_xml.m: Minor style improvements. |
||
|
|
8a28e40c9b |
Add the predicates sorry, unexpected and expect to library/error.m.
Estimated hours taken: 2 Branches: main Add the predicates sorry, unexpected and expect to library/error.m. compiler/compiler_util.m: library/error.m: Move the predicates sorry, unexpected and expect from compiler_util to error. Put the predicates in error.m into the same order as their declarations. compiler/*.m: Change imports as needed. compiler/lp.m: compiler/lp_rational.m: Change imports as needed, and some minor cleanups. deep_profiler/*.m: Switch to using the new library predicates, instead of calling error directly. Some other minor cleanups. NEWS: Mention the new predicates in the standard library. |
||
|
|
887a55f783 |
Make variable use analysis assume that the compiler cannot push signals or
waits for futures across module boundaries, which is usually true.
Add a new option to the feedback tool
--implicit-parallelism-intermodule-var-use. This option re-enables the old
behaviour.
Fix a number of bugs and improve the pretty-printing of candidate parallel
conjunctions.
deep_profiler/var_use_analysis.m:
Implement the new behaviour and allow it to be controlled.
Refactor some code to slightly reduce the number of arguments passed to
predicates.
deep_profiler/mdprof_feedback.m:
Implement the new command line option.
Conform to changes in feedback.automatic_parallelism.m.
deep_profiler/recursion_patterns.m:
Fixed a bug in the handling of can-fail switches.
deep_profiler/mdprof_fb.automatic_parallelism.m:
Fix a bug in the calculation of dependency graphs. All goals are
represented by vertexes and dependencies are edges. The program failed to
create a vertex for a goal that had no edges.
Fix a crash when trying to compute variable use information for a goal that
is never called. This was triggered by providing the new variable use
information in the feedback format.
Using the extra feedback information improve the pretty-printing of
candidate parallelisations.
Conform to changes in feedback.automatic_parallelism.m
Conform to changes in var_use_analysis.m
mdbcomp/feedback.automatic_parallelism.m:
Add the new option to control intermodule variable use analysis.
Provided more information in the candidate parallel conjunctions feedback.
The costs of the goals before and after the parallel conjunction are
now provided.
The cost of every goal is now provided (not just calls)
Variable production and consumption times of the shared variables are
provided for each goal if the analysis evaluated them.
Modified convert_candidate_par_conjunctions_proc/3 and
convert_candidate_par_conjunction/3 to pass a reference to the current
parallel conjunction to their higher order argument.
mdbcomp/feedback.m:
Increment feedback file version number.
deep_profiler/program_representation_utils.m:
Improve the pretty-printing of goal representations, in particular, their
annotations.
deep_profiler/create_report.m:
Conform to changes in var_use_analysis.m.
deep_profiler/display_report.m:
Conform to changes in program_representation_utils.m.
library/lazy.m:
Added a new predicate, read_if_val(Lazy, Value) which is true of Lazy has
already been forced and produced Value.
(No update to NEWS necessary).
|
||
|
|
91e60619b0 |
Remove the concept of 'partitions' from the candidate parallel conjunction
mdbcomp/feedback.automatic_parallelism.m:
Remove the concept of 'partitions' from the candidate parallel conjunction
type. We no-longer divide conjunctions into partitions before
parallelising them.
mdbcomp/feedback.m:
Increment the feedback format version number.
compiler/implicit_parallelism.m:
Conform to changes in mdbcomp/feedback.automatic_parallelism.m.
deep_profiler/mdprof_fb.automatic_parallelism.m:
Allow the non-atomic goals to be parallelised against one-another.
Modify the goal annotations used internally, many annotations used only for
calls are now used for any goal type.
Variable use information is now stored in a map from variable name to lazy
use data for every goal, not just for the arguments of calls.
Do not partition conjunctions before attempting to parallelise them.
Make the adjust_time_for_waits tolerate floating point errors more easily.
Format costs with commas and, in most cases, two decimal places.
deep_profiler/var_use_analysis.m:
Export a new predicate var_first_use that computes the first use of a
variable within a goal. This predicate uses a new typeclass to retrieve
coverage data from any goal that can implement the typeclass.
deep_profiler/measurements.m:
Added a new abstract type for measuring the cost of a goal, goal_cost_csq.
This is like cs_cost_csq except that it can represent trivial goals (which
don't have a call count).
deep_profiler/coverage.m:
Added deterministic versions of the get_coverage_* predicates.
deep_profiler/program_representation_utils.m:
Made initial_inst_map more generic in its type signature.
Add a new predicate, atomic_goal_is_call/2 which can be used instead of a
large switch on an atomic_goal_rep value.
deep_profiler/message.m:
Rename a message type to make it more general, this is required now that we
compute variable use information for arbitrary goals, not just calls.
library/list.m:
Add map3_foldl.
NEWS:
Announced change to list.m.
|
||
|
|
f16e8118bd |
Implement a linear alternative to the exponential algorithm that determines how
best to parallelise a conjunction.
Made other performance improvements.
mdbcomp/feedback.m:
Add a field to the candidate_parallel_conjunction_params structure giving
the preference of algorithm.
Simplify the parallel exec metrics type here. It is now used only to
summarise information that has already been calculated. The original code
has been moved into deep_profiler/measurements.m
Add a field to the candidate_par_conjunction structure giving the index
within the conjunction of the first goal in the partition. This is used
for pretty-printing parallelisation reports.
Incremented the feedback format version number.
deep_profiler/measurements.m:
Move the original parallel exec metrics type and code here from
mdbcomp/feedback.m
deep_profiler/create_report.m:
Avoid a performance issue by memoizing create_proc_var_use_dump_report
which is called by the analysis for the same procedure (at different
dynamic call sites) many times. In simple cases this more than doubled the
execution time, in more complicated cases it should perform even better.
Conform to changes in coverage.m
deep_profiler/mdprof_fb.automatic_parallelism.m:
Implement the linear algorithm for parallelising a conjunction.
Since we don't to parallelism specialisation don't try to parallelise the
same procedure more than once. This should avoid some performance problems
but I haven't tested it.
If it is impossible to generate an independent parallelisation generate a
dependent one and then report it as something we cannot parallelise. This
can help programmers write more independent code.
Use directed graphs rather than lookup maps to track dependencies. This
simplifies some code as the digraph standard library module already has
code to compute reverse graphs and transitive closures of the graphs.
Since there are now two parallelisation algorithms; code common to both of
them has been factored out.
The objective function used by the branch and bound search has been
modified to take into account the overheads of parallel execution. It is:
minimise(ParTime + ParOverheads X 2.0)
This way we allow the overheads to increase by 1csc provided that it
reduces ParTime by more than 2csc. (csc = call sequence counts)
When pretty-printing parallelisation reports print each goal in the
parallelised conjunction with it's new goal path. This makes debugging
easier for large procedures.
Fix a bug where the goal path of scope goals was calculated incorrectly,
this lead to a thrown exception in the coverage analysis code when it used
the goalpath to lookup the call site of a call.
deep_profiler/mdprof_feedback.m:
Support a new command line option for choosing which algorithm to use.
Additionally the linear algorithm will be used if the problem is above a
certain size and the exponential algorithm was chosen. This can be
configured including the fallback threshold.
Print the user's choice of algorithm as part of the candidate parallel
conjunctions report.
deep_profiler/message.m:
Add an extra log message type for exceptions thrown during auto
parallelisation.
deep_profiler/program_representation_utils.m:
The goal_rep pretty printer now prints the goal path for each goal.
deep_profiler/coverage.m:
procrep_annotate_with_coverage now catches and returns exceptions in a
maybe_error result.
deep_profiler/cliques.m:
Copy predicates from the standard library into cliques.m to prevent the
lack of tail recursion from blowing the stack in some cases. (cliques.m is
compiled with --trace minimum).
deep_profiler/callgraph.m:
Copy list.foldl from the standard library into callgraph.m and transform it
so that it is less likely to smash the stack in non tail-recursive grades.
deep_profiler/read_profile.m:
Transform read_nodes so that it is less likely to smash the stack in non
tail-recursive grades.
deep_profiler/Mercury.options:
Removed old options that where used to work around a bug. The bug still
exists but the work-around moved into the compiler long ago.
|
||
|
|
c877dceb2b |
Refactor profiler feedback code for implicit parallelism.
This change mostly re-factors the goal representation used to feedback implicit
parallelism information to the compiler. The goal_rep datatype is now used
rather than the much simpler datatype. (goal_rep is the same type that is used
by the declarative debugger).
This makes it easier for the compiler to match HLDS goals against goals from
the implicit parallelism analysis and will probably help in the future if the
analysis wants the compiler to re-order goals.
It also makes it easier to pretty-print the feedback sent to the compiler in
more detail.
mdbcomp/feedback.m:
As above, redefine pard_goal as a type alias to
goal_rep(pard_goal_annotation).
Added a new type, candidate_par_conjunctions_proc, it represents candidate
parallelisations within a procedure along with shared information for the
procedure.
Add a new predicate, convert_candidate_par_conjunctions_proc.
Increment the feedback file format version number.
mdbcomp/program_representation.m:
XXX: See about refactoring bytecode in/out put into one place.
Add a new predicate transform_goal_rep for transforming a goal_rep
structure from one arbitrary annotation type to another.
Add extra predicates to aid in converting a prog_rep structure to and from
bytecode. This includes cut_byte/2 and can_fail_byte/2.
deep_profiler/program_representation_utils.m:
Export print_goal_to_strings/4 so that it can be used when printing the
feedback file reports.
deep_profiler/mdprof_fb.automatic_parallelism.m:
Conform to changes in mdbcomp/feedback.m
Wrap some lines at 76 characters.
Improve explanations in comments.
Use the goal_rep pretty-printer to print the candidate parallel
conjunctions feedback report.
deep_profiler/mdprof_feedback.m:
Conform to changes in deep_profiler/mdprof_fb.automatic_parallelism.m
deep_profiler/program_representation_utils.m:
Modify print_goal_to_strings to print determinisms and annotations on
separate lines before each goal.
deep_profiler/display_report.m:
Modify pretty printing of coverage annotations so that they make sense
after modifying print_goal_to_strings/4.
compiler/implicit_parallelism.m:
Refactor goal matching code that compares HLDS goals to feedback goals.
Goal matching is now more accurate and can more easily support goal
re-ordering when parallelising code (this is not implemented yet).
The code that builds parallel conjunctions has also been refactored.
This pass now generates warnings if it is not able to parallelise
a candidate parallel conjunction in the feedback data.
Insert deeper and later parallelizations before shallower or earlier ones,
this makes it easier to continue to parallelise a procedure as it's goal
tree changes due to parallelisation.
Silently ignore duplicate candidate parallel conjunctions.
Refuse to parallelise a procedure that has been parallelized explicitly.
compiler/prog_rep.m:
Re-factor the hlds_goal to bytecode transformation, this transformation now
goes via goal_rep. We use the hlds_goal to goal_rep portion of this
transformation in compiler/implicit_parallelism.m.
Add variable names prefixed with DCG_ to the list of those introduced by
the compiler.
compiler/goal_util.m:
Modify maybe_transform_goal_at_goal_path so that it returns a value that
can describe the different kinds of error that may be encountered.
Add a new predicate, maybe_transform_goal_at_goal_path_with_instmap. Given
a goal, goal path and initial inst map this predicate recurses the goal
structure following the goal path and maintaining the inst map. It then
uses a higher order value to transform the goal at it's destination before
re-constructing the goal. It is different to
maybe_transform_goal_at_goal_path in that it passes the instmap to it's
higher order argument, the instmap is correct for the state immediately
before executing the goal in question.
compiler/hlds_pred.m:
Include the procedure's varset in the information used to construct the
program representation data that is included in deep profiling builds.
compiler/instmap.m:
Add a useful function, apply_instmap_delta_sv. This is the same as
apply_instmap_delta except that it's arguments are in a more convenient
order for state variable notation.
compiler/stack_layout.m:
Export compute_var_number_map for the use of implicit_parallelism.m and
prog_rep.m
compiler/error_util.m:
Add a new error phase, 'phase_auto_parallelism'. This is used for warnings
issued from the automatic parallelisation transformation.
compiler/deep_profiling.m:
Conform to changes in hlds_pred.m
compiler/mercury_compile_middle_passes.m:
Conform to changes in implicit_parallelism.m
compiler/type_constraints.m:
Conform to changes in goal_util.
|
||
|
|
b7f0270f36 |
Implement the new algorithm for calculating how dependant parallel conjuncts'
executions overlap. This algorithm has also been generalised to handle cases
where there are more than two conjuncts in a parallel conjunction. A number of
other improvements have also been made.
deep_profiler/mdprof_fb.automatic_parallelism.m:
Wrote dependant parallel conjunction overlap analysis algorithm (as above).
This algorithm introduced a new structure, parallel_execution_overlap.
This structure describes how dependant parallel executions overlap.
Use both sparking cost and sparking delay as costs of parallelisation.
Sparking cost is the cost from the perspective of the sparker, whereas
delay is the delay between creating the spark and actually beginning the
execution of the spark.
Handle pretty-printing of the candidate parallel conjunction structure.
Include variable identifiers as well as canonical names in the
pardgoal_type structure.
The inst_map_info structure has been modified to contain the sets of
consumed and produced variables separately, rather than simply containing a
set of all consumed and produced variables.
Improve the readability of messages printed by trace goals.
The search code no longer attempts to look up procedure bodies for code
whose module is "Mercury runtime".
Conjunctions that did not have a speedup due to parallelisation are now
printed out by a new trace goal.
deep_profiler/mdprof_feedback.m:
Include support for pretty printing the feedback information after
creating it. This is handled by the new --report command line option.
Include a new --implicit-parallelism-sparking-delay command line option.
This may be used to specify how long it takes an engine to steal a spark.
mdbcomp/feedback.m:
Export the sparking delay as part of the feedback information.
Create a new structure parallel_exec_metrics which contains many metrics
about parallel execution performance. This is exported for each candidate
parallel conjunction rather than only exporting the Speedup.
Create predicates for creating and querying the parallel_exec_metrics
structure.
Create a new predicate, get_all_feedback_data/2, this is used to retrieve
all the data for building the report in the mdprof_feedback tool.
Increment the feedback file format version number.
deep_profiler/message.m:
Improve the readability of the messages printed due to verbosity settings.
Export some predicates that can be used for managing indentation while
pretty-printing structures.
compiler/implicit_parallelism.m:
Conform to changes in feedback_data_candidate_parallel_conjunctions.
Add a pi_sparking_delay field to parallelism information.
deep_profiler/program_representation_utils.m:
Fix a bug in calc_inst_map_delta/3.
Correct a comment for inst_map_ground_vars/5.
deep_profiler/cliques.m:
Fixed a minor indentation issue.
deep_profiler/Mercury.options:
Document the new trace goal that enables printing of candidate parallel
conjunctions that do not result in a speedup.
|
||
|
|
79c3f39a68 |
Implicit parallelism work.
The implicit parallelism algorithm, feedback file format and therefore compiler
have been updated. They now support parallelisation across other goals and, in
theory, parallelising three or more calls against one another. The algorithm
is far from complete and very much experimental, it has been tested on a
modified version of icfp_2000 where it improves the runtime. Note that
automatic parallelisation of dependant conjunctions is disabled for now.
mdbcomp/feedback.m:
Modify deep profiling feedback data, a candidate parallel conjunct now
contains a list of sequential conjunctions that contain other goals.
Previously only two calls to be parallelised against one-another where
listed.
Document restrictions on the new candidate parallel conjunct structure that
can't be expressed by the type system.
Incremented the feedback file format number.
mdbcomp/program_representation.m:
Made a semidet predicate version of empty_goal_path.
Created maybe_search_var_name which returns it's result wrapped in a maybe
structure, this is a deterministic alternative to search_var_name. It is
useful as an argument to list.map
deep_profiler/mdprof_feedback.m:
When printing messages out to stderr also print the newlines between the
messages to stderr.
deep_profiler/measurements.m:
Re-aranged the order of arguments and added a four argument version for
sub_computation_parallelism.
Added a new function, some_parallelism/1, that initialises a parallelism
amount as.
deep_profiler/message.m:
Added extra messages.
Pretty-print program locations using the conventional string representation
for procedures and goal paths. Export the predicate that does this.
deep_profiler/program_representation_utils.m:
Export a predicate to format a procedure identifier nicely.
Add code for calculating and manipulating inst_map_delta objects similar to
those in the compiler.
deep_profiler/mdprof_fb.automatic_parallelism.m:
Various code cleanups/simplifications.
Re-worked the parallelisation algorithm, it can now parallelise across
cheaper calls and (theoretically) handle parallel conjunctions with any
number of conjuncts.
Conform to new candidate parallel conjunction representation.
Internally use a structure similar to the candidate parallel conjunct
structure in feedback.m This makes the maybe_call_conjunct structure
obsolete, the old structure has been removed.
compiler/implicit_parallelism.m:
Updated implicit parallelism transformation to conform to the new feedback
file format.
compiler/goal_util.m:
Added goal_is_atomic/2
Modified create_conj_from_list to simply return the only goal in the list
when the list contains exactly one goal.
library/maybe.m:
Add a simple predicate (maybe_is_yes/2) that 'opens' a maybe and returns the result or
fails.
NEWS:
Announce maybe_is_yes/2
|
||
|
|
10aaab5d62 |
Move the "missing" code to the right place, where the related types and
Estimated hours taken: 0.1 Branches: main deep_profiler/program_representation_utils.m: mdbcomp/program_representation.m: Move the "missing" code to the right place, where the related types and predicates are, i.e. program_representation.m in mdbcomp. |
||
|
|
d8a00d5a36 |
Fix a problem reported by Peter Wang that prevented the var_use_analysis module
Estimated hours taken: 0.25
Branches: main
Fix a problem reported by Peter Wang that prevented the var_use_analysis module
from compiling.
deep_profiler/program_representation_utils.m:
Re-add some accidentally deleted code when this module was split in three.
deep_profiler/var_use_analysis.m:
Mark an issue in the variable use analysis algorithm with an XXX.
|
||
|
|
3ad840ebb2 |
Increase the deep profiler's cohesion by dividing the
Estimated hours taken: 1 Branches: main Increase the deep profiler's cohesion by dividing the program_representation_utils.m module into three files: - coverage.m containing the coverage analysis algorithm, - var_use_analysis.m containing the variable use analysis algorithm, and - program_representation_utils.m itself containing generally useful predicates working on program representations. The last is actually the smallest file. There are no algorithm changes, only the movement of code and a few minor fixes of white space and typos in comments. deep_profiler/coverage.m: deep_profiler/var_use_analysis.m: New modules, as described above. deep_profiler/program_representation_utils.m: Delete the code moved to the new modules. mdbcomp/program_representation.m: Move some utility types and predicates here from deep_profiler/program_representation_utils.m, since they may be useful for other tasks. deep_profiler/report.m: Move the data types specific to coverage and var use analysis to the new modules, along with the utility predicates operating on them. Import the new modules as needed. deep_profiler/create_report.m: deep_profiler/displayreport.m: deep_profiler/mdprof_feedback.m: Import the new modules as needed. |
||
|
|
effa745ab5 |
Perform implicit parallelism analysis in mdprof_feedback.
Estimated hours taken: 27 Branches: main Perform implicit parallelism analysis in mdprof_feedback. This calculates the amount of parallelism available in dependant conjunctions and advises the compiler how to parallelise code via the feedback system. deep_profiler/mdprof_feedback.m: Implement implicit parallelisation analysis. deep_profiler/program_representation_utils.m: Add a simple implementation of inst maps which are used by the implicit parallelisation analysis. This implementation also tracks that variables that are required in order to instantiate a variable. Export some procedures used by the variable use analysis for use in the parallelisation analysis in mdprof_feedback.m Create an extra predicate to retrieve all the variables used by an atomic goal. Move utility code in this module to the end. deep_profiler/report.m: Add utility function to convert cost_until_var_use values to raw values either since the beginning of the procedure or before the end. mdbcomp/feedback.m: Modified the format of implicit parallelism feedback information. Incremented the feedback file format version. mdbcomp/program_representation.m: Added a procedure to search for a variable name in a variable table and fail if it cannot find it. |
||
|
|
f23dc12e7b |
Add an analysis report to the deep profiler that can determine when an
Estimated Hours Taken: 15 Branches: main Add an analysis report to the deep profiler that can determine when an argument to a procedure is likely to be consumed or produced. This is useful for determining the parallelism within dependant conjunctions. Due to limitations in the deep profiler recursive code cannot be handled well, the following two problems (and workarounds) exist. If the variable we're searching for uses of is consumed or produced within a recursive (or mutually recursive) call, we do not follow this recursion. Instead assume a pessimistic default, that if the call produces the variable assume it's produced at the end of the call, if the call consumes the variable assume it's consumed at the beginning of the call. When calculating the cost of a goal that occurs before a consumption or after a production we cannot relative an accurate cost of a recursive call from the deep profiler (A cost of 1.0 is returned). deep_profiler/report.m: Add the new report structure. deep_profiler/program_representation_utils.m: The code for the new analysis depends on the program representation bytecode, it has been added to this module. deep_profiler/create_report.m: Code to create the new report. deep_profiler/display_report.m: Basic code to display the report. deep_profiler/query.m: Include support for parsing and running the commands that refer to this new report. Conform to changes in report.m deep_profiler/old_html_format.m: deep_profiler/old_query.m: Conform to changes in report.m |
||
|
|
a69fe81c08 |
Make coverage propagation code and algorithm simpler.
Estimated hours taken: 2
Branches: main
Make coverage propagation code and algorithm simpler. There are two
motivations for this change: 1. it's easier to describe a simpler algorithm
in a paper (and this simpler algorithm has no disadvantages over the more
complicated one). 2. The simplified algorithm is actually more sound, since
it doesn't make the false assumption that exceptions do not exist.
deep_profiler/program_representation_utils.m:
The coverage propagation algorithm no longer attempts to update the
coverage before a goal.
The coverage after a goal other than a unification cannot be calculated
from the coverage before it and it's determinism. Since an exception may
be thrown from within that goal, effecting its exit port count.
|
||
|
|
4ebb2781ac |
Cleaning up of coverage propagation code. In particular I've addressed issues
Estimated hours taken: 0.5
Branches: main
Cleaning up of coverage propagation code. In particular I've addressed issues
that were flagged as 'XXX' by Zoltan. I've also relaxed some of the checking
code that was written assuming exceptions were never used.
deep_profiler/program_representation_utils.m:
As above.
|
||
|
|
36dbbd377f |
Make the output for switches more reader friendly by making the '('
Estimated hours taken: 0.1
Branches: main
deep_profiler/program_representation_util.m:
Make the output for switches more reader friendly by making the '('
line up with the matching ')'.
|
||
|
|
38ea2ae9d3 |
Simplify the coverage propagation algorithm in several respects.
Estimated hours taken: 8 Branches: main Simplify the coverage propagation algorithm in several respects. First, pass around the coverage before and after each goal separately, since almost all decisions affect the two program points differently. This allows us to eliminate much code whose job it used to be to split up coverage_infos and merge them back together just so they could be split again the next time around. In this new arragement, we join them together only when they are final and about to be attached to the goal they annotate. Second, we now explicitly assume that updating either the before or after count of a goal cannot lose knowledge, i.e. that we cannot go from e.g. before_known(X) to before_unknown. This *should* have been true with the previous system as well, but it was hard to see, because the code used to deliberately reset one or other of the before and after counts to unknown when processing subgoals. This diff deletes the code that tried to reestablish this invariant. Third, we now separate out the data structures used to hold sums of execution counts, and give them their own type to avoid possible mixups. deep_profiler/program_representation_utils.m: Make the changes above. The improved conceptual clarity allows us to move much of the complexity of the main coverage propagation algorithm into utility predicates, thus raising the level of abstraction. In a few places, the updated algorithm can propagate more coverage information than the old version. deep_profiler/program_representation_utils.m: mdbcomp/program_representation.m: Change the names of some function symbols to add the _rep suffix, to fit in with the naming scheme we use for the other components of program representations. deep_profiler/report.m: Rename a function symbol to make help avoid misunderstanding of its meaning. deep_profiler/display_report.m: Conform to the change to report.m. |
||
|
|
feadc37bd4 |
Modify the program representation bytecode to include mode information for the
Estimated hours taken: 3
Branches: main
Modify the program representation bytecode to include mode information for the
head variables of a procedure.
Modes in the program representation bytecode and structure are represented as
an initial instantiation state, and a final instantiation state. These can
have one of the three values each: free, ground and other.
mdbcomp/program_representation.m:
Introduce new types head_var_rep, var_mode_rep and inst_rep.
Head variables of a proc_defn_rep structure now use the head_var_rep type.
Add head_var_to_var function.
Add code to read in mode information with head variables from progrep
bytecode.
Increment the Deep.procrep file format version number.
Use a higher order abstraction to remove duplicated code.
compiler/prog_rep.m:
Write out bytecodes for the modes of procedures' head variables.
deep_profiler/program_representation_utils.m:
Conform to changes in mdbcomp/program_representation.m
Print out the mode information for each variable in the head of a
procedure.
Use a higher order abstraction to remove duplicated code.
browser/declarative_tree.m:
Conform to changes in mdbcomp/program_representation.m
runtime/mercury_deep_profiling.c:
Increment the Deep.procrep file format version number.
|
||
|
|
c2009fea28 |
Post-commit review of some of Paul's latest changes.
Estimated hours taken: 0.3 Branches: main 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. |
||
|
|
af722bcfd8 |
Coverage profiling refactoring. Remove some unnecessary code.
Estimated hours taken: 0.1 Branches: main Coverage profiling refactoring. Remove some unnecessary code. deep_profiler/program_representation_utils.m: As above. |
||
|
|
eaec101864 |
Reduce the number of coverage points required for disjunctions.
Estimated hours taken: 0.5 Branches: main Reduce the number of coverage points required for disjunctions. The coverage after a disjunction is equal to the sum of the coverage after each disjunct, this can be used to avoid placing a coverage point after each disjunction. deep_profiler/program_representation_utils.m: compiler/deep_profiling.m: As above. |
||
|
|
6740d50f27 |
Coverage profiling refactoring.
Estimated hours taken: 0.75
Branches: main
Coverage profiling refactoring.
deep_profiler/program_representation_utils.m:
Move the get_coverage_information predicate into the
goal_annotate_coverage. A lot of this code is now distributed among the
switch on the goal expression, making this code fit more closely with the
coverage profiling transformation.
|
||
|
|
20ec777aea |
Fix many comments and other problems Zoltan has flagged in the coverage
Estimated hours taken: 0.5 Branches: main Fix many comments and other problems Zoltan has flagged in the coverage profiling code. A bug preventing the deep profiling grade from working has also been fixed. compiler/deep_profiling.m: deep_profiler/program_representation_utils.m: Fix many comments, delete irrelevant nonsensical comments. library/profiling_builtin.m: Ensure that the arguments of increment_coverage_point_count/2 are named. |
||
|
|
53b5ab7bd0 |
Cleanups of code I read as part of reviewing Paul's last change.
Estimated hours taken: 1 Branches: main Cleanups of code I read as part of reviewing Paul's last change. This is not the post-commit review itself. deep_profiler/program_representation_utils.m: Convert a couple of semidet predicates into functions returning bool, so we could check that every case is covered. Fix departures from our style guide. Add XXXs for unclear documentation. deep_profiler/report.m: Add some documentation. mdbcomp/program_representation.m: Add a utility function. |
||
|
|
cec7c88915 |
Re-write coverage profiling transformation and propagation algorithm.
Estimated hours taken: 10 Branches: main Re-write coverage profiling transformation and propagation algorithm. The code in the profiler and in the compiler both now traverse a procedure in the same way. This way the coverage profiling transformation knows if the coverage propagation algorithm will be able to infer the coverage at a given point in the program or if it needs a coverage point inserted. compiler/deep_profiling.m: As above. Print out status messages before performing deep profiling on each procedure when the verbose option is enabled.. compiler/options.m: The first pass of the coverage profiling transformation has been disabled since it's not currently used by the second pass. compiler/mercury_compile.m: Conform to changes in compiler/deep_profiling.m compiler/Mercury.options: Disable the work around for bug 85 since it is no longer triggered by deep_profiling.m. deep_profiler/program_representation_utils.m: As above. Fix a bug when printing out a scope goal in the procedure representation. |
||
|
|
7a86a73ef2 |
Alter the program representation bytecode used by the the declartive debugger
Estimated hours taken: 0.5
Branches: main
Alter the program representation bytecode used by the the declartive debugger
and deep profiler. Modify the representation of a switch goal to include
information about whether it is complete.
mdbcomp/program_representation.m:
Create the new type 'switch_can_fail_rep'.
Include a field in the switch_rep alternative of the goal_expr_rep type.
Process an extra byte to give the completeness of a switch when reading in
switch goals.
Increment procrep file version number.
compiler/prog_rep.m:
Write out an extra byte for switches describing if the switch is complete.
runtime/mercury_deep_profiling.c:
Increment progrep file version number.
browser/declarative_tree.m:
deep_profiler/program_representation_utils.m:
tests/debugger/declarative/builtin_call_rep.exp:
tests/debugger/declarative/dependency.exp:
Conform to changes in mdbcomp/program_representation.m
|
||
|
|
8658fc1cc9 |
Introduce a new report type in the deep profiler tools.
Branches: main
Introduce a new report type in the deep profiler tools. The procedure
representation coverage report displays a representation of the procedure,
annotated with determinism and coverage information. This allows a programmer
to view the most frequently taken execution paths through a procedure,
This report is available when the program has been compiled for coverage
profiling, and when a Deep.procrep file is available.
deep_profiler/report.m:
The coverage profiling dump report is now a coverage_information annotated
procedure representation structure.
Add a goal_path field to the call_site_perf type.
deep_profiler/program_representation_utils.m:
Create procrep_annotate_with_coverage/5 predicate to annotate a procedure
representation structure with coverage information.
Use type classes to convert goal annotations to strings used with the
procedure representation structures.
deep_profiler/create_report.m:
Call procrep_annotate_with_coverage to build the coverage-annotated
procedure representation report.
deep_profiler/display_report.m:
Conform to changes in deep_profiler/report.m
Implement a goal_annotation typeclass for coverage_info for displaying the
coverage information.
Display a link to the procrep_coverage report from the Procedure report.
deep_profiler/mdprof_cgi.m:
Add the ability to generate a procrep_coverage report to the command line
interface for debugging.
deep_profiler/mdprof_test.m:
Add the ability to generate all the procrep coverage reports possible from
a Deep.data file.
Make compressing the result (using a separate gzip process) optional,
since it can slow down the test for a negligible gain.
|
||
|
|
4f561c08cf |
Store goal paths as a reverse-sorted list rather than a cord.
Estimated time taken: 3 hours. Branches: main Store goal paths as a reverse-sorted list rather than a cord. This ensures they are safe for use as keys in maps since their semantic and structural representations are the same. Goal paths are now an abstract type, making it easy to change their representation in the future. Modules in the program representation, and procedures in the module representation are now stored in maps. library/list.m: Add an extra mode to list.reverse, reverse(out, in) is det. mdbcomp/program_representation.m: As above. browser/declarative_tree.m: compiler/build_mode_constraints.m: compiler/deep_profiling.m: compiler/goal_path.m: compiler/hlds_data.m: compiler/hlds_goal.m: compiler/hlds_out.m: compiler/mode_constraint_robdd.m: compiler/mode_constraints.m: compiler/mode_ordering.m: compiler/ordering_mode_constraints.m: compiler/polymorphism.m: compiler/smm_common.m: compiler/trace_gen.m: compiler/tupling.m: compiler/unneeded_code.m: deep_profiler/mdprof_procrep.m: deep_profiler/program_representation_utils.m: Conform to above changes, compiler/rbmm.condition_renaming.m: Conform to above changes, note that this module already used goal_paths as map keys. |
||
|
|
cfe35c9cb7 |
Modify the deep profiling tools, in particular mdprof_cgi, to make use of
Estimated Hours Taken: 10 Branches: main Modify the deep profiling tools, in particular mdprof_cgi, to make use of program representation files, and begin implementing the procrep coverage report. The mdprof coverage report is incomplete, however it is convenient to post this for review now. Currently it can display a pretty-printed procrep structure without coverage annotations. mdbcomp/program_representation.m: Modified program representation data structures to allow goals to be annotated with another type. deep_profiler/query.m: Create new deep profiling command, to display a coverage-annotated procedure representation. Support use of program representation information by new-style report generating code. Centralised command parsing to code within this module. Created constants for strings shared between cmd_to_string and string_to_maybe_cmd. deep_profiler/report.m: Add new report, report_procrep_coverage_dump. Modified the proc_static dump report to include the number of coverage points in the proc_static. deep_profiler/create_report.m: create_report now accepts an optional program representation structure, making it possible for report generation code to use the program representation structure. Support the new procrep coverage report, which is incomplete. Modify the proc static dump report, to display the number of coverage points within a proc_static structure. deep_profiler/display.m: Introduce display_verbatim, a new display element that is able to display verbatim text, such as source code. deep_profiler/display_report.m: Add support for displaying the new mdbcomp_coverage report. Modify the proc static dump display to show the number of coverage points, conforming to a change in report.m deep_profiler/html_format.m: Support the display_verbatim element. Use query_to_string from query.m to create the query part of a URL. Conform to changes in deep_profiler/query.m deep_profiler/startup.m: Modify read_and_startup to also read the program representation data if available. deep_profiler/mdprof_cgi.m: Use string_to_maybe_query from query.m to parse a query string. Renamed some variables. Modified command-loop to pass program representation between commands. deep_profiler/program_representation_utils.m: A new module to hold utilities from working with program representation data. Pretty printing code from mdprof_procrep has been moved here and modified to output a cord of strings rather than write to standard output. deep_profiler/mdprof_feedback.m: deep_profiler/mdprof_test.m: Conform to changes in query.m deep_profiler/mdprof_procrep.m: Move proc_rep pretty-printing code to program_representation_utils.m browser/declarative_tree.m: Conform to changes in mdbcomp/program_representation.m |