Estimated hours taken: 10
Add constant propagation within modules. This occurs during simplification
and simply attempts to evaluate "known" calls that have all their inputs
bound to constants and replaces the call with constructions of the outputs.
Currently the "known" calls are (most) of the arithmetic predicates, and
the comparison of ints and floats.
compiler/instmap.m:
add merge_instmap_deltas which merges a list of intmap deltas
rather than just two of them.
compiler/mercury_compile.m:
compiler/options.m:
add (and use) the option --optimize-constant-propagation
compiler/simplify.m:
add a bool to the simplify struct to turn on/off constant
propagation.
in the simplification of calls, check to see if all the inputs
are bound to constants. If we know how to evaluate this call
at compile time, then do so. This may change the instmap delta.
For branched goals, we merge the instmap deltas to recompute the
instmap delta for the goal as a whole so that we know when every
branch binds a variable to the same constant.
compiler/notes/compiler_design.html:
mention constant propagation.
doc/user_guide.texi:
mention constant propagation.
compiler/const_prop.m:
code that attempts to evaluate calls at compile time.
It contains tables of calls that we know how to evaluate.
Automate the building of releases, including daily "rotd"
(release-of-the-day) releases.
VERSION:
New file, defines the version number.
Also document the general scheme for assigning version numbers.
Mmake.common.in:
Add `include VERSION'.
Mmakefile:
bindist/Mmakefile:
configure.in:
Use the version number in VERSION rather than hard-coding it
in multiple places.
Mmakefile:
README:
.README.in:
INSTALL:
.INSTALL.in:
Change things so that README and INSTALL are automatically
generated from .README.in and .INSTALL.in respectively, using
the version number defined in VERSION.
BUGS:
Remove an unnecessary reference to the version number.
RELEASE_NOTES:
Change this file so that the version number is only mentioned
in one place. Bump the version number here to 0.7 in preparation
for the next release.
library/Mmakefile:
library/library.m:
library/library.m.in:
Change things so that library.m is automatically generated from
library.m.in using the version number in VERSION.
Also change it so that library__version says which architecture
it was configured for.
tools/test_mercury:
Override the version specified in the VERSION file in the CVS
repository with either `rotd-YYYY-MM-DD' or (when making a release)
with a specified $RELEASE_VERSION.
When running on murliboobo, if the version built passes all its
tests, copy it to the /pub/mercury/beta-releases directory on
ftp://turiel.cs.mu.oz.au.
compiler/notes/release_checklist.m:
Change the release checklist to say that you only need to
update the version number in VERSION rather than in 6 different
places. Also change the procedure for building the final
tar file to reflect the above changes to the `test_mercury' script.
Estimated hours taken: 0.05
Update compiler design notes.
compiler/notes/compiler_design.html:
Update design notes with regard to continutation_info.m, and
remove mention of garbage_out.m and shapes.m.
Estimated hours taken: 20
Reorganisation of modules to do with the inst data type.
This is actually the first installment of the alias tracking mode
checker in disguise. A very good disguise. The rationale for
this reorganisation is to reduce coupling in the part of the mode
checker which is _not_ in this change (ie most of it).
Alias tracking requires a new kind of inst, alias(inst_key), where
an inst_key is a handle on some other sub-inst. With it goes a
data structure in which to store dereferenced insts and all the
operations which go with it. This code will go in the new module
inst.m so that it doesn't have to go in prog_data.m. (I briefly
considered putting it in instmap.m however this introduces some
bad coupling since instmap.m imports hlds_module.m. Putting it
in prog_data.m would cause hlds_*.m to depend on prog_data.m,
but we have designed things so that the dependencies go in the
other direction.)
The remainder of the reorganisation is a general cleanup: the
inst testing predicates (inst_is_*) have been moved out of
mode_util because they are not actually operations on modes at
all, and have been moved into inst_match. inst_match has then
been split because otherwise it would be 2000 lines long and
will get significantly bigger when aliasing is added. Roughly
speaking, any operations which create new insts from old ones
have been moved into a new module, inst_util while any operations
which test the values of insts remain in inst_match.
Also included are the removal of some NU-Prologisms since the
NU-Prolog version of the compiler is no longer supported. Two
changes here:
- Removal of some when declarations.
- A gross hack in inst_is_*_2, where two copies of
the same inst were passed into the predicate so that
one could be switched on. Thank NU-Prolog's lack of
common subexpression elimination.
compiler/inst.m:
New module which contains the data types inst, uniqueness,
pred_inst_info, bound_inst.
compiler/inst_util.m:
New module which contains predicates which perform mode
checking-like operations on insts.
Moved in:
abstractly_unify_inst, abstractly_unify_inst_functor,
inst_merge, make_mostly_uniq_inst (from inst_match.m)
compiler/inst_match.m:
Moved out:
inst_merge, make_mostly_uniq_inst,
abstractly_unify_inst, abstractly_unify_inst_functor
(to inst_util.m)
Moved in:
inst_is_*, inst_list_is_*, bound_inst_list_is_*
(from mode_util.m)
Now exported:
unique_matches_initial/2, unique_matches_final/2
inst_contains_instname/3, pred_inst_matches/3
(They are required by inst_util.m, and they are
useful in their own right.)
compiler/instmap.m:
instmap_delta_lookup_var/3 reincarnated as
instmap_delta_search_var/3. The reason for this change is
that previously, instmap_delta_lookup_var simply returned
`free' if the searched-for var did not occur in the
instmap_delta. This is somewhat non-obvious behaviour.
instmap_delta_search_var/3 fails in such a situation.
compiler/mode_util.m:
Moved out:
inst_is_*, inst_list_is_*, bound_inst_list_is_*
(to inst_match.m)
(These are not really operations on modes.)
compiler/modecheck_call.m:
Moved in modecheck_higher_order_func_call/5, from modecheck_unify.m
compiler/modecheck_unify.m:
Moved out modecheck_higher_order_func_call/5, to modecheck_call.m
where it should have been all along.
compiler/prog_data.m:
Moved out the types inst, uniqueness, pred_inst_info,
bound_inst (to inst.m).
compiler/common.m:
compiler/cse_detection.m:
compiler/fact_table.m:
compiler/higher_order.m:
compiler/hlds_data.m:
compiler/hlds_goal.m:
compiler/hlds_out.m:
compiler/intermod.m:
compiler/liveness.m:
compiler/llds.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
compiler/mode_debug.m:
compiler/mode_errors.m:
compiler/mode_info.m:
compiler/modes.m:
compiler/module_qual.m:
compiler/polymorphism.m:
compiler/prog_io.m:
compiler/prog_io_util.m:
compiler/prog_util.m:
compiler/simplify.m:
compiler/switch_detection.m:
compiler/unify_proc.m:
compiler/unique_modes.m:
Miscellaneous minor changes to cope with the above changes.
compiler/notes/compiler_design.html:
Document the new modules.
Estimated hours taken: 0.2
todo.html:
Removed "being done by jammb", since he isn't working on Mercury
anymore. Added a note that petdr is supposed to be working on
data type specialization. Clarified a point about attribute grammars.
Estimated hours taken: 0.25
compiler/notes/compiler_design.html:
Mention that common.m also does elimination of duplicate procedure
calls, not just of common structs.
Estimated hours taken: 1
compiler/notes/todo.html:
Update the todo list to reflect things that have been done.
Move some items from the TODO section to the WISHLIST section.
Change the indentation slightly to make it easier to read
the ASCII source.
Estimated hours taken: 0.1
[This was stayl's change to COMPILER_DESIGN that somehow didn't get
incorporated when COMPILER_DESIGN became compiler_desing.html.]
compiler/notes/compiler_design.html:
Added some more documentation on module qualification.
Estimated hours taken: 0.1
Change the filenames of the .html files to lowercase.
This is essentially a gratuitous aesthetic change. 8^)
compiler/notes/Mmakefile
Estimated hours taken: 0.2
Added target for creating plain text equivalents of the HTML documents.
We use the file extension .text for the plain text documents.
All these docs are installed on the web pages.
Also added a target to clean away the generated plain text files.
mercury/compiler/notes/Mmakefile:
Estimated hours taken: 0.1
Removed the original plain text documents in this directory since they've
now been translated into HTML. In order to produce plain text from
the HTML docs, we can use the facilities of the text browser Lynx:
lynx -dump file.html > file.text
compiler/notes/
ALLOCATION
AUTHORS
CODING_STANDARDS
COMPILER_DESIGN
GC_AND_C_CODE
GLOSSARY
MODULE_SYSTEM
RELEASE_CHECKLIST
REVIEWS
TODO
Estimated hours taken: 4
Translated plain text docs to HTML. This obviously creates
a dual update problem. We should solve this by putting
the plain text docs in the attic and retaining the HTML.
Also added the HTML files to the Mmakefile so they are installed
on the web pages.
The other documents in compiler/notes will be HTMLized soon.
compiler/notes/
Mmakefiles
ALLOCATION.html
AUTHORS.html
CODING_STANDARDS.html
COMPILER_DESIGN.html
GC_AND_C_CODE.html
GLOSSARY.html
MODULE_SYSTEM.html
RELEASE_CHECKLIST.html
REVIEWS.html
TODO.html
Estimated hours taken: 0.1
Cut-n-paste error.
mercury/compiler/notes/Mmakefile:
I copied another Mmakefile and accidentally left some rubbish in it.
Why did I not test the Mmakefile before checkeding it in?
It is not possible to test changes to this Mmakefile without
first checking in, since the install_webpage script checks
out the latest version of the Mmakefile when installing the
web pages. This problem should be fixed.
Estimated hours taken: 0.3
Added Mmakefile for installing web docs.
mercury/compiler/notes/Mmakefile:
We need an Mmakefile to install these developer documents
into the webpages in the `developer' directory.
Estimated hours taken: 0.05
Add two new items to the TODO list.
compiler/notes/TODO:
- Add extended DCGs to wish list, and removing limitation on
monomorphic higher order terms to TODO list.
Estimated hours taken: 0.2
COMPILER_DESIGN:
Document modules mode_debug, modecheck_call and modecheck_unify.
Changed references to *.pp files since we don't use them any more.
Estimated hours taken: 2.5
Rewrite and clarify review policy.
compiler/notes/CODING_STANDARDS:
Remove most of the text on reviews, move it into REVIEWS.
Put in a reference to REVIEWS.
compiler/notes/REVIEWS:
New document, describes review procedures and policies.
Estimated hours taken: 0.25
compiler/notes/COMPILER_DESIGN
Updated now that common.m and excess.m are no longer separate passes.
compiler/notes/TODO
Remove duplicate call warning.
Estimated hours taken: 0.25
compiler/notes/CODING_STANDARDS:
Mention that people should review their changes themselves
before sending them to someone else to review.
Estimated hours taken: 2
ALLOCATION:
Revise the method of handling non-forward-live variables that are
needed at resumption points. Clarify what an "occurrence" means.
Estimated hours taken: 0.1
ALLOCATION:
Rename the cont_lives field in the new design to resume_point.
Since this field now gives not just the set of vars that must be
saved, but also determines how many (and which) labels the resumption
point will have, the new name is more descriptive. It also avoids
conflict with the name of the existing cont_lives field.
Estimated hours taken: 10
ALLOCATION:
A total rewrite of this document. It now describes the approach
we will take in rewriting some parts of the code generator.
Estimated hours taken: 0.75
notes/COMPILER_DESIGN:
Update to reflect the fact that expansion of equivalence types
is now in its own module, equiv_type.m.
Estimated hours taken: 0.5
notes/CODING_STANDARDS:
Add more detailed guidelines on layout of comments,
if-then-elses and type definitions. Mention that
language features such as functions shouldn't be used yet.
Estimated hours taken: 0.25
compiler/notes/TODO:
Update now that we've done a few things (type inference,
.mod files implemented using C interface, predicate overloading,
lookup-switches, warnings about unused arguments).
Estimated hours taken: 0.5
compiler/notes/MODULE_SYSTEM
Update the specification for the all-singing, all-dancing
module system to include a new `module_ops' symbol specifier,
after discussions with Peter Schachte.