Use the word "corresponding" instead of "preceding" in error messages like:
Error: clause for predicate `foo'/0 without preceding `:- pred'
declaration.
The language imposes no ordering on declarations so there is no sense in which
the `:- pred' declaration has to precede the clause. This is doubly true for
`:- typeclass' and `:- instance' declarations, which may also occur in
different source files from each other.
compiler/make_hlds_error.m:
compiler/add_class.m:
Make the above change.
Delete a comment regarding this issue.
tests/invalid/*/.err_exp:
Update expected error outputs.
Make our changes to support Winpthreads match those of upstream
bdwgc commit 94b85eea2e2713c7a6071f1965b1e98e645e65a7
boehm_gc/include/private/gc_locks.h:
boehm_gc/win32_threads.c:
As above.
compiler/options.m:
doc/user_guide.texi:
'vars' is used as a abbreviation for 'variables' in all compiler
command line options except two: --no-warn-singleton-variables and
--no-warn-undefined-options-variables. Add synonyms for these options
that use 'vars'.
compiler/hlds_goal.m:
As above.
Put some of the remaining stuff in a more logical order.
compiler/make_goal.m:
This new module contains the predicates, previously in hlds_goal.m,
that construct new goals.
compiler/hlds.m:
compiler/notes/compiler_design.html:
Include the new module.
compiler/goal_form.m:
Move to this existing module the predicates previously in hlds_goal.m
that test whether goals have particular forms (which is the task of
this module).
compiler/*.m:
Conform to the above. Note that no module requires a new import
of BOTH make_goal and goal_form.
compiler/delay_partial_inst.m:
Separate out the important code: handling constructions and deconstructions
involving partially instantiated terms.
Put the predicates in a logical order.
compiler/hlds_goal.m:
Provide insts for each kind of unification.
Remove some existing insts that were redundant.
compiler/accumulator.m:
compiler/distance_granularity.m:
compiler/higher_order.m:
compiler/lco.m:
compiler/structure_reuse.indirect.m:
Conform to the change to hlds_goal.m.
configure.ac:
Always build the par_gc library with GC_WIN32_PTHREADS when
pthread.h is detected on MinGW* systems. Previously, if the
pthread implementation is not pthread-win32 we would fallback to
building Boehm GC with GC_WIN32_THREADS (no "P"), so it would
NOT provide pthread wrapper functions. But since pthread.h was
found, the Mercury implementation would make pthread calls, calls
which are not intercepted by Boehm GC and thus unsafe.
Change `--with-gc-pthreads-win32' to `--with-gc-win32-pthreads',
to mean either of pthreads-win32 or winpthreads.
Winpthreads is a pthreads implementation from the MinGW-w64 project,
different from pthreads-win32. A similar patch to this should make its
way into Boehm GC upstream. As we will not be upgrading Boehm GC on the
14.01 branch, apply this small change to our copy of the library for now.
boehm_gc/include/private/gc_locks.h:
Winpthreads uses scalar thread IDs.
boehm_gc/win32_threads.c:
Winpthread thread IDs should be practically unique but make the
conservative assumption anyway.
The changes to the platforms that I am unable to test are based on the
boehm_gc/configure script. If that script allows the features to be
enabled then I assume that the features are usable.
configure.ac:
Enable parallel marking on Solaris (untested by me).
Enable on Cygwin (untested by me).
Enable on MinGW32 (tested).
Enable on MinGW-w64 (tested with winpthreads, which requires some
other changes).
Enable on Darwin (tested by Julien).
compiler/hlds_goal.m:
The is_exist_constr field of rhs_functor, which used to be represented by
a synonym of boolean. Make this type an enum type.
compiler/*.m:
Conform to the above change.
The event sequence that lead to the compiler abort in Mantis 351 was:
1 With -O5 --intermod-opt, the loop invariant optimization finds a loop
invariant in the pos_mul_karatsuba predicate in library/integer.m.
2 To create the inner predicate (the one that has the already-computed
invariant passed to it), it tries to make a copy of the original predicate,
but sets the has_parallel_conj field of the new proc's proc_info to the
default value, which is has_no_parallel_conj.
3 A later compiler pass has the task of (in par grades) adding synchronization
to parallel conjunctions, and (in non-par grades) converting the parallel
conjunctions to sequential. However, due to the has_no_parallel_conj flag
in the proc_info, it thinks it has no work to do. It therefore leaves the
parallel conjunction intact.
4 The pre-code-generation simplification pass traverses the entire body of
the predicate, and, seeing a parallel conjunction, puts a has_parallel_conj
flag on the proc_info.
5 generate_proc_code sees this flag, but since the target grade is not
parallel, it ignores the flag. Since debugging is not enabled either,
it does NOT create a ContainingGoalMap. (The debugger and parallel
conjunctions are the two things that need this map.)
6 When trying to create the id for the parallel conjunction, par_conj_gen.m
looks for the ContainingGoalMap. Not finding it, it aborts.
The problem arises in step 2, and the main part of the bug fix is to step 2.
However, it adds a sanity check to step 5 as well, to make any such problems
easier to diagnose in the future.
compiler/hlds_pred.m:
Require callers of proc_info_create and similar predicates to specify
whether the new procedure has parallel conjunctions or not.
Arrange the code of these predicates so that all the fields in the
proc_info are filled in with variables whose names say what they stand
for. Previously, many of the fields were just "no" or "[]", not saying
what `maybe' type or list there was no information for.
Put these variables in the same order as the fields.
Add a XXX about the possibility of similar bugs.
compiler/loop_inv.m:
When creating the inner procedure (and its containing predicate),
pass the has_parallel_conj flag of the original predicate. This is
the actual bug fix.
compiler/par_conj_gen.m:
Improve some comments.
compiler/parallel_to_plain_conj.m:
Set a procedure's flag to has_no_parallel_conj right after eliminating
all the parallel conjunctions in it.
compiler/proc_gen.m:
Add a sanity check: if a procedure has has_parallel_conj, then require
that the grade be a parallel grade.
compiler/accumulator.m:
compiler/add_pred.m:
compiler/add_special_pred.m:
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/clause_to_proc.m:
compiler/clause_to_proc.m:
compiler/lambda.m:
compiler/make_hlds.m:
compiler/par_loop_control.m:
compiler/pd_info.m:
compiler/stm_expand.m:
compiler/table_gen.m:
compiler/tupling.m:
compiler/unify_proc.m:
compiler/untupling.m:
Conform to the changes above.
compiler/goal_path.m:
When filling in the goal ids in a procedure body, avoid building 234 trees
that we have keep modifying. Build a simple list, and convert it to a
234 tree all at once at the end. Repeated insertions into a 234 tree
leave several garbage cells behind per insertion (at least one per level of
the tree), whereas our new method leaves just one pair cell and one cons
cell per goal id.
trace/mercury_trace.h:
Avoid a warning from the C compiler about casting -1 to an enum
by adding bool next to the enum that says whether the enum is actually
defined, or is supposed to be set later (the latter is what the cast -1
meant).
trace/mercury_trace_cmds.h:
Rename the type MR_Trace_Command_Info to MR_TraceCmdTableEntry,
since this (a) says more about the values of the type, (b) avoids
confusion with the separate MR_TraceCmdInfo type (the one that
contained the enum mentioned above), and (c) avoids combining
underscores with CamelCase.
trace/mercury_trace_spy.c:
Avoid some warnings about switches on enums specifying -1 as a case.
trace/mercury_trace.c:
trace/mercury_trace_*.[ch]:
Conform to the above changes.
compiler/hlds_pred.m:
Replace some uses of booleans in proc_infos with specialized types.
Put the fields involved into a more logical order. Give their access
predicates more meaningful names.
When creating new proc_infos, give names to all the arguments of
proc_infos and proc_sub_infos. (I believe Mantis bug 351 is in
these arguments.)
compiler/hlds_module.m:
Use the new types in hlds_pred.m where relevant.
compiler/parallel_to_plain_conj.m:
Add some conditionally combined debugging output that helped me track down
the problem.
compiler/loop_inv.m:
mdbcomp/mdbcomp.goal_path.m:
Minor cleanup of some comments.
compiler/code_info.m:
compiler/deforest.m:
compiler/dep_par_conj.m:
compiler/distance_granularity.m:
compiler/granularity.m:
compiler/hlds_out_pred.m:
compiler/inlining.m:
compiler/introduce_parallelism.m:
compiler/lambda.m:
compiler/mark_tail_calls.m:
compiler/mercury_compile_middle_passes.m:
compiler/par_loop_control.m:
compiler/proc_gen.m:
compiler/simplify_goal_call.m:
compiler/simplify_goal_conj.m:
compiler/simplify_info.m:
compiler/simplify_proc.m:
compiler/trace_gen.m:
compiler/trace_params.m:
Conform to the changes above.
It was not explicitly stated that --link-object and MLOBJS may specify
archives to link with. The Mercury build system uses that fact, the
documentation contains some examples doing so, and it has been a
consideration since at least commit eadcd7ab00,
so document it as a supported feature.
compiler/options.m:
doc/reference_manual.texi:
doc/user_guide.texi:
Mention archives in --link-object and MLOBJS documentation.
When --restricted-command-line is enabled, we try to shorten the link
command by creating a temporary archive of object files, including files
specified with --link-object. --link-object can also be used to specify
archives (.a) to link with, which results in nested archives in the
temporary archive. The linker does not look for object files in nested
archives so it does not work as intended.
compiler/compile_target_code.m:
Create the temporary archive for --restricted-command-line
consisting of only the file names in ObjectsList with known
object file extensions. Pass any other names in ObjectsList
to the link command directly.
As Tomas By's recent emails suggest, this support is doing more harm than good,
by falsely implying to people that MPS is a viable alternative to the Boehm
collector. The MPS collector was only ever experimental, and never performed
as well as Boehm. MPS isn't even in the git repository on git hub. It was
stored in a separate CVS repository on mundula, and (as far as I know)
wasn't carried over to github. The code of MPS was last touched a long time
ago; I would be surprised if it worked on today's systems without changes.
Mmake.common.in:
Mmake.workspace:
RESERVED_MACRO_NAMES:
boehm_gc/Mmakefile:
compiler/add_pragma.m:
compiler/compile_target_code.m:
compiler/globals.m:
compiler/handle_options.m:
compiler/mercury_compile_mlds_back_end.m:
compiler/mlds_to_c.m:
compiler/options.m:
compiler/peephole.m:
doc/user_guide.texi:
library/benchmarking.m:
runtime/Mmakefile.m:
runtime/mercury.h:
runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
runtime/mercury_heap.h:
runtime/mercury_init.h:
runtime/mercury_memory.h:
runtime/mercury_wrapper.[ch]:
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/ml.in:
scripts/parse_grade_options.sh-subr:
util/mkinit.c:
Remove all references to MPS.
tests/general/weak_ptr.m:
tests/general/weak_ptr.exp:
tests/hard_coded/Mmakefile:
tests/general/Mmakefile:
Move week_ptr test into tests/hard_coded
The weak_ptr test should te executed conditionally, this is easy to do in
the hard_coded/ test suite.
tests/general/weak_ptr.m:
Fix spelling error.
tests/general/weak_ptr.exp2:
Remove unnecessary file.
Thread pools are often used to reduce poor performance on embarrassingly
parallel work loads. This isn't immediately necessary on the Java backend
however I've implemented it because:
+ It will be required when we implement parallel conjunctions for the
Java backend.
+ I want to implement parallel profiling on the Java backend and don't
want to have to implement this once now, and then re-implement it after
introducing thread pools later.
We want the thread pool to generally restrict the number of threads that are
in use, this reduces overheads. However, when one or more tasks become
blocked then it can be desirable to create extra threads, this helps ensure
that all processors are kept busy and that thread pooling doesn't contribute
to any deadlocks itself. The implementation is a work in prograss and
currently does not implement this second feature.
Java's API provides several different thread pools, see
java.util.concurrent.Executors, none of which are suitable. Specifically
the fixed thread pool is unsuitable as we want to be able to temporarily
exceed the normal number of threads as explained above; and the cached
thread pools, which are also very similar to the ThreadPoolExecutor class,
do not implement the correct algorithm for determining when a new thread
should be created (they can still perform poorly for embarassingly parallel
workloads). Additionally we cannot instrument this code as easily for
parallel profiling.
These changes alter the behaviour of Mercury threads on the Java backend in
two ways, they now behave more correctly and more like threads on the C
backends.
+ If a thread throws an exception it is now reported and the program is
aborted. Previously it was ignored and let pass to the Java runtime
where I assume it was reported.
+ The program now exits only after all threads have exited.
The ThreadPool will automatically detect the number of threads to use, or if
the -P flag is given in the MERCURY_OPTIONS environment variable it will
honor that.
java/runtime/MercuryThread.java:
java/runtime/MercuryThreadPool.java:
java/runtime/MercuryWorkerThread.java:
java/runtime/Task.java:
java/runtime/ThreadStatus.java:
These new classes make up the thread pool. A MercuryThread is an
abstract class for Mercury threads, MercuryWorkerThread is a concrete
subclass of MercuryThread which includes the worker thread behaviour.
A Task is a computation/closure that has not yet been started, it
provides some methods not available in Java's generic Runnable and
Callable classes. The others should be self-explanatory and all files
contain documentation.
java/runtime/Getopt.java:
java/runtime/MercuryOptions.java:
Parse the MERCURY_OPTIONS environment variable for the -P flag.
java/runtime/JavaInternal.java:
Add support for handling Mercury exceptions, this is used in case a
worker thread's task (a Mercury thread) throws an exception.
compiler/mlds_to_java.m:
The main method of the main Java class of an application now starts and
uses the thread pool to execute main/2.
library/exception.m:
Export exception reporting code to the Java runtime system.
library/thread.m:
Use the thread pool for thread.spawn.
Make consistency improvements to error messages concerning initialise, finalise
and mutable declarations.
compiler/make_hlds_error.m:
Pass a list of format_components to error_if_exported/5 and
error_is_exported/4 as the item description instead of a string.
compiler/add_pragma.m:
compiler/make_hlds_passes.m:
Conform to the above change.
compiler/modes.m:
Use the pragma_decl/1 format component in a couple of spots.
tests/invalid/bad_finalise_decl.err_exp:
tests/invalid/bad_initialise_decl.err_exp:
tests/invalid/bad_mutable.err_exp:
tests/invalid/imported_mode.err_exp:
tests/invalid/not_in_interface.err_exp:
tests/invalid/uniq_mutable.err_exp:
Conform to the above changes.
The two main changes in this commit are:
(1) Use the error_util library's decl/1 and pramga_decl/1 format components in more
places.
(2) Quote type variables that appear in error messages.
compiler/error_util.m:
Add a version of list_to_pieces/1 that places each of the strings in
the input list in single quotes.
compiler/prog_io_type_defn.m:
Quote type variables names in error messages.
compiler/add_class.m:
compiler/add_pragma.m:
compiler/add_pred.m:
compiler/check_typeclass.m:
compiler/make_hlds_error.m:
compiler/post_typecheck.m:
compiler/prog_io.m:
Use the error_util library's decl/1 and pragma_decl/1 format components
in more places.
compiler/mode_errors.m:
Quote program variables and insts in some error messages.
compiler/post_term_analysis.m:
Format a type ctor and arity in an error message properly.
tests/invalid/*.err_exp:
tests/warnings/*.exp:
Conform to the above changes.
compiler/simplify_goal_disj.m:
Look for the conditions that lead to the bug (a disjunction that
further instantiates an already partially instantiated variable).
Generate an error message when found, PROVIDED that this happens
in a context in which the surrounding procedure can succeed
more than once. (If it cannot, then you cannot invoke an all-solutions
predicate on it, and the bug cannot happen.)
This condition (a model_non surrounding procedure) was motivated
by mdbcomp/feedback.m, which does not compile without it.
compiler/simplify_info.m:
The simplify_info type used to contain four different kinds of fields:
1 static fields; set and then never changed, such as the id of the
containing procedure
2 global information, such as the varset and vartypes, which are updated
as new variable are added, and whose updates need to be kept regardless
of what part of the procedure is analyzed next
3 information about the context surrounding the goal currently being
analyzed, such as the number of lambda expressions we are inside
4 information about the point in the code before the goal currently being
analyzed, such as the set of equivalences that currently hold between
variables (part of common_info).
The code of the simplify_goal*.m modules used to have jump through hoops
to handle 3 and 4 properly, given that the simplify_info was being
threaded through code in a way that was suitable only for 1 and 2.
This change takes categories 3 and 4 out of the simplify_info.
It creates a new type, simplify_nested_context, for category 3,
and adds information about the ability of the procedure surrounding
the current point to succeed more than once (needed for the bug311 fix)
to this new type.
compiler/simplify_tasks.m:
Rename the do_once task to mark_code_model_changes, since this
expresses what the task is much less ambiguously.
compiler/simplify_goal*.m:
compiler/simplify_proc.m:
compiler/common.m:
compiler/mercury_compile_front_end.m:
compiler/mercury_compile_llds_back_end.m:
Conform to the changes to simplify_info (and simplify_tasks).
Pass the current instmap and common_info (the two category 4 fields)
separately.
Mark some places that could be improved.
compiler/hlds_out_mode.m:
Generate easier-to-understand debugging output. I needed this to track
down a bug in my initial fix.
compiler/inst_match.m:
Remove a redundant unification that couldn't fail (since it was invoked
only if the exact same unification succeeded a few lines earlier).
Apply another minor optimizations.
compiler/instmap.m:
Remove references to the alias branch. It won't be coming back.
compiler/error_util.m:
Fix some documentation.
mdbcomp/feedback.m:
Put related stuff together.
tests/warnings/bug311.{m,err_exp}:
New test case for the bug.
tests/warnings/Mmakefile:
Enable the new test case.
Add two new format components to the error_util library: decl/1 and
pragma_decl/1. These are converted into strings as follows:
decl(<Decl>) ==> `:- <Decl>'
pragma_decl(<Decl>) ==> `:- pragma <Decl>'
The motivation for this change is that error messages about declarations
often contain text similar to:
... in `:- foo' declaration ...
At least that is what occurs most of the time; in some cases the `:-' part is
omitted, in other cases the quotes are omitted. Using the new format
components makes these consistency problems less likely to occur. The error
specs are also more concise as well.
This commit also addresses a number of other minor issues related to error.
compiler/error_util.m:
Add the two new format components describe above.
Use add_quotes/1 as a single point of control for how single quotes
are added where possible in this module.
Call unexpected/3 in preference to error/1.
compiler/goal_expr_to_goal.m;
Quote the word 'else' when referring the 'else' part of a try goal
in an error message.
compiler/hlds_out_util.m:
Add an XXX comment about cons_ids being incorrectly quoted in
error messages.
compiler/det_report.m:
Pass the message description to report_determinism_problem/7 as a list
of format_components rather than as a string.
compiler/make_hlds_warn.m:
Capitalize the word "Warning" when it occurs at the beginning of a warning.
compiler/typecheck_errors.m:
compiler/modules.m:
Fix problems I noticed during my previous change.
compiler/add_pragma.m:
compiler/add_type.m:
compiler/det_analysis.m:
compiler/make_hlds_passes.m:
compiler/modules.m:
compiler/oisu_check.m:
compiler/prog_io.m:
compiler/prog_io_mode_defn.m:
compiler/prog_io_mutable.m:
compiler/prog_io_pragma.m:
compiler/prog_io_sym_name.m:
compiler/term_constr_errors.m:
compiler/term_errors.m
compiler/termination.m:
compiler/typecheck_errors.m:
Conform to the above changes.
tests/invalid/bad_finalise_decl.err_exp:
tests/invalid/bad_initialise_decl.err_exp:
tests/invalid/bad_mutable.err_exp:
tests/invalid/bug83.err_exp:
tests/invalid/ee_invalid.err_exp:
tests/invalid/foreign_enum_import.err_exp:
tests/invalid/foreign_enum_invalid.err_exp:
tests/invalid/foreign_type_missing.err_exp:
tests/invalid/hawkins_mm_fail_reset.err_exp:
tests/invalid/loopcheck.err_exp:
tests/invalid/nested_impl_in_int.err_exp:
tests/invalid/oisu_check_add_pragma_errors.err_exp:
tests/invalid/oisu_check_semantic_errors.err_exp:
tests/invalid/reserve_tag.err_exp:
tests/invalid/try_io_else.err_exp:
tests/warnings/foreign_term_invalid.exp:
tests/warnings/warn_return.exp*:
tests/warnings/warn_succ_ind.exp*:
Update expected (error) outputs to conform to the above.
No progress has been made on the LLDS->x86_64 backend since the initial work on
it and it is now more have a maintenance headache then anything else.
compiler/llds_to_x86_64.m:
compiler/llds_to_x86_64_out.m:
compiler/x86_64_instrs.m:
compiler/x86_64_out.m:
compiler/x86_64_regs.m:
Delete these modules.
compiler/globals.m:
Delete the x86_64 target type.
compiler/*.m:
Conform to the above changes.
The glibc implementation of malloc (commonly used on Linux) can use sbrk
to acquire more memory, and so does Boehm GC in its default configuration
on Linux. When both allocators are invoked simultaneously from different
threads then memory corruption may result.
configure.ac:
Add --enable-gc-mmap option.
Make --enable-gc-munmap imply --enable-gc-mmap.
Detect mmap and set MR_HAVE_MMAP.
Detect sbrk and set MR_HAVE_SBRK.
On Linux (and potentially other platforms), build Boehm GC for
threaded grades with -DUSE_MMAP if mmap was found.
Mmake.common.in:
Add ENABLE_BOEHM_USE_MMAP.
runtime/mercury_conf.h.in:
Add MR_HAVE_MMAP, although it is not used anywhere yet.
Add MR_HAVE_SBRK. It is only for used by the test program.
tests/hard_coded/Mmakefile:
tests/hard_coded/thread_sbrk.exp:
tests/hard_coded/thread_sbrk.exp2:
tests/hard_coded/thread_sbrk.m:
Add test program.
NEWS:
Announce changes.
compiler/add_clause.m:
compiler/det_report.m:
compiler/mode_errors.m:
compiler/modes.m:
Use the sym_name_and_arity format component where appropriate.
compiler/term_constr_errors.m:
Fix whitespace.
tests/invalid/invalid_main.err_exp:
Conform to the above.
Replace spots in error message specs. where single quotes are hardcoded as `' with
the error_util library's quote/1 constructor.
Fix minor issues with some error messages and add a couple of XXX comments
about some others.
compiler/accumulator.m:
compiler/add_clause.m:
compiler/add_pragma.m:
compiler/add_pred.m:
compiler/add_type.m:
compiler/det_analysis.m:
compiler/det_report.m:
compiler/goal_expr_to_goal.m:
compiler/make_hlds_error.m:
compiler/mercury_compile.m:
compiler/mode_errors.m:
compiler/modes.m:
compiler/modules.m:
compiler/options_file.m:
compiler/post_typecheck.m:
compiler/prog_io.m:
compiler/prog_io_pragma.m:
compiler/simplify_goal.m:
compiler/simplify_proc.m:
compiler/term_constr_errors.m:
compiler/term_errors.m:
compiler/termination.m:
compiler/typecheck.m:
compiler/typecheck_errors.m:
As above.
tests/invalid/errors.err_exp:
tests/invalid/missing_det_decl.err_exp:
tests/invalid/no_exports.err_exp:
tests/invalid/predmode.err_exp:
tests/invalid/undef_type.err_exp:
Conform to the above changes.
compiler/simplify_conj.m:
As above. Use a cord to store the sequence of already processed conjuncts,
instead of reversing and rereversing lists of goals. (The original code
was written before cords were available.)
library/benchmarking.m:
library/bit_buffer.m:
library/exception.m:
library/gc.m:
library/io.m:
library/library.m:
library/thread.m:
library/time.m:
Add `thread_safe' or `not_thread_safe' to foreign procs
where it is clear which is correct.
The mutvar procedures are not truly thread-safe but neither does
obtaining a global lock make them become thread-safe in a useful way,
except perhaps avoiding data races. On the other hand, the global lock
inhibits parallelism in programs that do use mutvars in a thread-safe
manner.
library/store.m:
As above.
NEWS:
Announce change.
The objective of this change is to improve module cohesion, with each
of the new modules doing only one task, or two or three closely related tasks.
Moving common.m into the new simplify package also improves information hiding,
since the details of the simplify_info data structure that common.m needs
aren't exposed to the rest of the compiler anymore.
This change mostly moves code around. There are no algorithmic changes.
In several places I did
- make predicate names more meaningful,
- reordered predicate definitions to put related predicates together
(previously, the predicates involved in simplifying a particular kind of goal
were often interspersed with predicates that worked only on other kinds of
goals), and
- improved documentation (in some places expanding it, in some places
correcting comments that suffered bit-rot and were out-of-date).
compiler/simplify.m:
This file is now a package, including its submodules,
but no code anymore.
compiler/simplify_goal.m:
New submodule containing generic processing of goals.
compiler/simplify_goal_call.m:
compiler/simplify_goal_unify.m:
compiler/simplify_goal_conj.m:
compiler/simplify_goal_disj.m:
compiler/simplify_goal_switch.m:
compiler/simplify_goal_ite.m:
compiler/simplify_goal_scope.m:
New submodules containing goal-type-specific processing of goals.
Each of these modules is much more cohesive than the original simplify.m
ever was; most export only one predicate per handled goal type.
compiler/simplify_info.m:
New submodule containing the definition of simplify_info
and its access predicates.
compiler/simplify_tasks.m:
New submodule listing the tasks that the simplification pass
may be asked to perform.
compiler/simplify_proc.m:
New submodule containing the top-level processing of procedures.
compiler/common.m:
Make this module a part of the simplify package. It is only ever invoked
by simplification, and leaving it outside the package would require
exporting more than a few internal details of simplify_info.
compiler/format_call.m:
Make this module a part of the simplify package. It does its job during
simplification, even though the need for it is noted during determinism
analysis.
compiler/check_hlds.m:
Remove common.m and format_call.m from the list of direct submodules
of check_hlds.m. (They are now indirect submodules, through
check_hlds.simplify.)
compiler/notes/compiler_design.html:
Document the new modules, and the new status of common and format_call..
compiler/pd_util.m:
Move some code from here to the new simplify_proc.m, since it allows us
to avoid exposing internal details of how simplification works.
compiler/mercury_compile_front_end.m:
Move a predicate here from the old simplify.m, since the job it does
belongs here.
Remove the ability to disable the invocation of cse_detection.
This capability was only ever needed when measuring the effectiveness
of determinism analysis for a paper; it hasn't been needed in a decade.
compiler/cse_detection.m:
Improve the top level comment.
compiler/options.m:
doc/user_guide.texi:
Remove the option that used to control the invocation of cse_detection.
compiler/*.m:
Conform to the split of simplify.m, importing its submodules where needed.
Support the fused multiply-add operation in C grades, where the underlying math
library provides it. Add a predicate that allows program to test for the
presence of this operation.
(The non-C target languages do not currently provide this operation.)
library/math.m:
Add the function fma/3.
Add the predicate have_fma/0 which can be used to test for the
presence of fma operation in the current grade / platform.
configure.ac:
runtime/mercury_conf.h.in:
Check whether the C99 fma() function is available.
NEWS:
Announce the above.
compiler/delay_partial_inst.m:
Avoid unnecessarily splitting a predicate in two.
Eliminate a number of unnecessary accesses and updates to the module
info.
Return the list of changed pred ids in order.
Add conditional trace goals to write out procedure bodies
if this pass changes them.