Estimated hours taken: 6
compiler/mercury_to_mercury.m:
compiler/mode_errors.m:
Make the code a little bit more readable:
use specific types rather than `bool' in a few places.
compiler/mercury_to_mercury.m:
Fix bugs in the generation of interface files where it was
outputting certain graphic tokens incorrectly. In particular,
it was outputting things like `module:?' without any parentheses,
space, or quotes to separate the `:' as module qualifier from
the symbol name.
tests/hard_coded/Mmakefile:
tests/hard_coded/quoting_bug.m:
tests/hard_coded/quoting_bug_test.m:
tests/hard_coded/quoting_bug_test.exp:
Add some tests for the above-mentioned bug fix.
tests/term/*.trans_opt_exp:
tests/misc_tests/pretty_print_test.exp:
Update expected output for these tests to reflect the
above changes.
Estimated hours taken: 0.5
Avoid about half of the slow "mmake realclean"s required by a bootcheck.
tests/*/runtests:
Concentrate all the actions performed before the test and after
a successful tests (both of which involve an "mmake realclean")
into two scripts, tests/{startup,shutdown}.
tests/shutdown:
Clean up the directory, and touch the file CLEAN.
tests/startup:
If the file CLEAN exists and is the most recent file in the directory,
consider the directory clean to beging with. Otherwise, run mmake
realclean.
Estimated hours taken: 0.5
tests/misc_tests/Mmakefile:
tests/misc_tests/pretty_print_test.exp:
Update the expected output for the pretty_print_test
test case to reflect the actual output, and re-enable
that test case. Arguably the extra parentheses in
the output are undesirable, but they're needed to
protect against the parser getting confused by
the relative precedence of `:' and `/' for
module-qualified symbols (e.g. in `.int' files).
Also arguably the precedence of `:' is wrong,
but it's probably not worth fixing this now since
we plan to replace `:' with `.'.
Also change the rule for `clean_ugly' to avoid hard-coding
the path name `/bin/rm' and to instead use just `rm'.
In some environments (e.g. Windows with gnu-win32),
`rm' might not be in `/bin'.
Estimated hours taken: 2
Mmakefile:
Remove .ugly files as part of the clean rule. Without this,
the .ugly file does not get remade, and the test is useless
(it does not invoke the compiler at all).
Temporarily disable the test (pretty_print_test) that uses a
.ugly file, since it does not work.
Estimated hours taken: 400
Deforestation.
This increases the code size of the compiler by ~80k when compiling
with --intermodule-optimization --deforestation.
The improvement from deforestation is not measurable for mmc -C make_hlds.m.
Compile time for make_hlds.m increased from 50.7 seconds to 52.2 seconds
when running deforestation.
compiler/simplify.m
compiler/common.m
Provide a nicer interface for simplifying a goal,
not an entire procedure.
Rework the interface to avoid manipulating lots of booleans.
Return an estimate of the improvement in cost from simplification.
Remove failing cases and disjuncts.
Add an option to optimize common structures even across calls.
Remove code to merge branched goals, since that is now
done by deforestation.
Fix a bug: the code to collect instmap_deltas for cases was not
including the switched-on variable in the instmap_delta,
which caused an abort in merge_instmap_delta if the switched
on variable was further instantiated in the switch.
This came up while compiling the compiler with --deforestation.
compiler/det_report.
Output duplicate call warnings even if --warn-simple-code is not set.
XXX fix the same problem with `:- pragma obsolete'.
compiler/code_aux.m
Update code_aux__cannot_loop to use termination information.
compiler/hlds_pred.m
compiler/dnf.m
Pass the type_info_varmap and typeclass_info_varmap
into hlds_pred__define_new_pred.
Restrict the variables of the new procedure onto the variables
of the goal.
Make sure all relevant type_infos are passed into the new
procedure if --typeinfo-liveness is set.
compiler/modes.m
compiler/unique_modes.m
compiler/mode_info.m
compiler/modecheck_unify.m
Put `how_to_check_goal' into the mode_info, rather
than passing it around.
Add a field to the `check_unique_modes' case which
controls whether unique modes is allowed to choose
a different procedure. For deforestation, this is
not allowed, since it could result in choosing a less
efficient procedure after generalisation.
compiler/options.m
New options:
--deforestation
--deforestation-depth-limit
Safety net for termination of the algorithm.
--deforestation-cost-factor
Fudge factor for working out whether deforestation
was worthwhile.
--deforestation-vars-threshold
Like --inline-vars-threshold.
Enable deforestation at -O3.
Removed an unnecessary mode for option_defaults_2, since it
resulted in a warning about disjuncts which cannot succeed.
compiler/handle_options.m
--no-reorder-conj implies --no-deforestation.
compiler/inlining.m
Separate code to rename goals into inlining__do_inline_call.
compiler/hlds_goal.m
Added predicates goal_list_nonlocals, goal_list_instmap_delta
and goal_list_determinism to approximate information about
conjunctions.
compiler/hlds_module.m
Added module_info_set_pred_proc_info to put an updated
pred_info and proc_info back into the module_info.
compiler/hlds_out.m
Exported hlds_out__write_instmap for debugging of deforestation.
Bracket module names on constructors where necessary.
compiler/mercury_compile.m
Call deforestation.
Use the new interface to simplify.m.
compiler/intermod.m
Put recursive predicates with a top-level branched goal
into `.opt' files.
goal_util.m
Added goal_calls_pred_id to work out if a predicate is
recursive before mode analysis.
Export goal_util__goals_goal_vars for use by deforestation.
Give a better message for a missing variable in a substitution.
compiler/instmap.m
Give a better message for inst_merge failing.
compiler/notes/compiler_design.m
Document the new modules.
library/varset.m
Add varset__select to project a varset's names and values
onto a set of variables.
doc/user_guide.texi
Document deforestation.
Remove a reference to a non-existent option, --no-specialize.
util/mdemangle.c
profiler/demangle.m
tests/misc_tests/mdemangle_test.{exp,inp}
Handle the `DeforestationIn__' predicate names introduced by
deforestation, similar to the `IntroducedFrom__' for lambda goals.
New files:
deforest.m Deforestation.
pd_cost.m Cost estimation.
pd_debug.m Debugging output.
pd_info.m State type and version control.
pd_term.m Termination checking.
pd_util.m Utility predicates
Estimated hours taken: 0.2
tests/runtests:
tests/*/runtests:
When reporting the results, print the options that controlled
the tests, so you don't have to search for them.
tests/*/runtests:
Clean up the directory if the tests are successful, in order
to reduce disk space usage.
Estimated hours taken: 0.1
tests/misc_tests/debugger_test.exp:
Update the expected debugger output to reflect my recent change
to library/io.m which changed the way io__write prints out values
of type `c_pointer'.
Estimated hours taken: 1.5
compiler/mercury_to_mercury.m:
Tidy up the output of typeclass and instance declarations.
Previously there were a number of minor problems (instance
declarations not implemented, unnecessary parentheses,
newlines in wrong places).
tests/misc_tests/Mmakefile:
tests/misc_tests/pretty_print_test.m:
tests/misc_tests/pretty_print_test.exp:
Add a test case for pretty-printing.
Estimated hours taken: 0.5
tests/misc_tests/Mmakefile:
Turn off tracing tests in `fast' and `jump' grades. The
stack_layouts they rely on don't yet work in these grades.
Estimated hours taken: 0.2
tests/misc_tests/debugger_test.exp:
Update the expected output after my recent change to the
formatting of the output of the tracer.
Estimated hours taken: 1.5
This change fixes a bug in the tracer's handling of the virtual registers
that are not real registers.
runtime/mercury_regs.h:
Make the saved_reg macro refer only to the given save area,
not to the machine registers or to the fake_reg array.
runtime/mercury_trace.c:
Make sure we save both real and fake registers in the save area.
Make the internal functions and variables static, and make sure
everything is prefixed by MR_. Use string concatenation in several
places to make the code shorter.
tests/misc_tests/debugger_regs.{m,inp,exp}:
A regression test case to make sure the tracer is handling high
register numbers properly.
Estimated hours taken: 20
Use stack layout tables to transmit information to the tracer, to allow
the tracer to print the names and values of variables at CALL and EXIT ports.
Extend stack layout tables to permit this.
For the time being the tables do not contain information about how to fill
in pseudo-typeinfos, so printing only works for monomorphic procedures.
compiler/llds.m:
Allow space for variable names in the information we gather about live
variables at given labels.
compiler/llds_out.m:
Print out variable names in the information we gather about live
variables at given labels in comments.
compiler/continuation_info.m:
Include variable names in the information we gather about live
variables at given labels.
Record the determinism of each procedure, not its code model.
compiler/{call_gen,code_gen,code_info}.m:
Include the names of variables in the data given to
continuation_info.m.
compiler/options.m:
Add a new developer-only option, --procid-stack-layout, whose effect
is to extend stack_layout structures with static info identifying the
procedure. This is used by execution tracing, and could (should) be
used by stack tracing and profiling.
Rename --alternate-liveness as --typeinfo-liveness. This is more
expressive. Later we should add a new option --trace-liveness, which
preserves every variable until the end of the clause for use by
the trace debugger.
compiler/handle_options.m:
Handle the option implications of --procid-stack-layout.
compiler/stack_layout.m:
Include the encoded determinism instead of the code model in stack
layout tables.
Include variable names in the live data section of stack layout tables
if they are available.
Include procedure identification information in the stack layout tables
if --procid-stack-layout is set.
compiler/trace.m:
Use the new interface to MR_trace.
compiler/*.m:
Trivial changes following from the renaming of --alternate-liveness.
runtime/mercury_accurate_gc.h:
Add macros to decode encoded determinisms.
Define structs for accessing the stack layout tables.
runtime/mercury_regs.h:
Define a macro similar to virtual_reg, except in that it can refer
to an arbitrary memory area, not just fake_reg.
runtime/{mercury_string,mercury_types}.h:
Move the typedefs of Char, UnsignedChar, String and ConstString
from mercury_string.h to mercury_types.h to avoid problems with
circular #includes.
runtime/mercury_trace.[ch]:
Revise the interface to MR_trace so that it takes the layout table
of the procedure as an argument. From the layout table, we can get
to the module name, predicate name, arity, mode number, and
determinism of the procedure, so we don't need to pass these any more,
reducing parameter passing overhead. We can also get to information
about where the input and output arguments are. We now use this
information to allow the user to print out the value of the arguments
at the CALL and EXIT ports.
Change the prompt to a less intrusive "mtrace> ".
runtime/mercury_wrapper.[ch]:
Add a new global variable, MR_library_trace_browser. We reserve space
for this variable in mercury_wrapper.c. It will be initialized by the
automatically generated xxx_init.c file to point to the procedure
that the tracer will invoke to let the user browse the values of
variables. This mechanism allows the runtime to maintain its current
ignorance about the contents of the standard library.
util/mkinit.c:
Generate additional code in the xxx_init.c files to fill in the value
of MR_library_trace_browser.
tests/misc_tests/debugger_test.{inp,exp}:
Add a few printing commands into the input for this test case, and
update the expected output.
Estimated hours taken: 0.1
tests/misc_tests/Mmakefile:
A small bug fix: add `./' at the start of the invocation of
debugger_test, so that it works even if you don't have `.'
in your PATH.
Estimated hours taken: 0.5
tests/misc_tests/Mmakefile:
tests/misc_tests/debugger_test.m:
tests/misc_tests/debugger_test.inp:
tests/misc_tests/debugger_test.exp:
Add a test case for the `--generate-trace' debugger.
Estimated hours taken: 1
Fix a bug that caused problems with profiling.
util/mdemangle.c:
profiler/demangle.m:
When demangling lambda goals, include the sequence number
and module name in the demangled name.
The profiler requires that the mapping between mangled
and demangled names must be one-to-one.
tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
Update the tests to reflect the new demangling algorithm.
Estimated hours taken: 0.5
util/mdemangle.c:
Fix a bug introduced in Tom's recent changes to handle
lamdbda goals: for ordinary predicates, it was just
printing out the module name, not the predicate name.
tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
Some regression tests for the above bug fix.
Estimated hours taken: 0.25
tests/misc_test/mdemangle_test.inp:
Update to reflect my recent change to the name mangling algorithm
(which was to make things work with Windows DLLs): s/entry/_entry/g.
and in the profiler.
util/mdemangle.c:
Add code to demangle the special-case names properly.
tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
Modify the expected output to reflect the bug fix to util/demangle.c.
profiler/demangle.m:
New module: contains a procedure for demangling Mercury labels.
profiler/demangle_test.m:
Test harness for demangle.m. Duplicates the functionality of
util/demangle.c. (Currently not used for anything except testing,
but we might one day want to use this code to replace util/demangle.c)
profiler/read.m:
Use the code in demangle.m to demangle labels.
profiler/output.m:
Output the alphabetic listing using one column rather than two,
since the demangled names are often too long to fit in a two-column
format.
profiler/options.m:
profiler/prof_info.m:
Remove some unnecessary `import_module' declarations.
compiler/unused_args.m:
Fix a bug in the mangling of predicate names for unused-arg
versions of special preds (index, compare, unify).
Estimated hours taken: 0.3
util/mdemangle.c:
Fix mdemangle to handle `base_type_functors'.
tests/misc_tests/mdemangle_test.inp:
Add a test case for `base_type_functors'.
Estimated hours taken: 5
Remove support for term_to_type and type_to_term implemented as special
preds. Remove support for one-cell and one-or-two-cell type_infos (now
shared-one-or-two-cell type_infos). Move definitions that were in
mercury_builtin.m back to where they belong.
This code has been removed because it is no longer used, and was no
longer being maintained but was still quite complex.
tests/general/disj_disj.m:
tests/general/dnf.m:
tests/general/higher_order.m:
tests/general/nondet_disj.m:
tests/hard_coded/cc_nondet_disj.m:
tests/hard_coded/pragma_inline.m:
tests/invalid/funcs_as_preds.err_exp:
tests/misc_tests/mdemangle_test.exp:
tests/valid/agc_unbound_typevars.m:
tests/valid/middle_rec_labels.m:
tests/valid/subtype_switch.m:
tests/warnings/infinite_recursion.m:
Import module `list' or `term' (or both).
Estimated hours taken: 6
Fix bugs in the scripts for running tests.
tests/handle_options:
Quote EXTRA_CFLAGS and EXTRA_MCFLAGS so that we can use
eval in runtests.
tests/Mmake.common:
Set MGNUCFLAGS using $(EXTRA_MGNUFLAGS) and $(EXTRA_CFLAGS)
tests/*/runtests:
Don't pass empty strings as arguments to mmake, as this can
tickle bugs in make.
Try
make -f foo.123 ""
on a CASE machine or hydra (not kryten, it has a different
version of gnu-make). It will chop the `23' from that string.
So when using `make -f mmake.$$', only the single digit pids
work, which is fairly limiting.
Estimated hours taken: 1
Add test for mdemangle.
tests/misc_tests/Mmake:
tests/misc_tests/runtests:
Scaffolding for testing in this directory.
tests/misc_tests/mdemangle_test.inp:
tests/misc_tests/mdemangle_test.exp:
Test input and expected output for mdemangle, includes currently
mangled symbols and expected outputs.