excess:
A new pass to remove unnecessary assignment unifications.
mercury_compile:
Call the new excess assignment module.
options:
Add a new option, excess_assign, to control the new optimization.
Add another, num-real-regs, to specify how many of r1, r2 etc are
actually real registers. The default is now set to 5 for kryten;
later it should be supplied by the mc script, with a value determined
at configuration time.
tag_switch:
Use num-real-regs to figure out whether it is likely to be worthwhile
to eliminate the common subexpression of taking the primary tag of
a variable. Also fix an old performance bug: the test for when a
jump table is worthwhile was reversed.
value_number, vn_block:
Do value numbering on extended basic blocks, not basic blocks.
vn_debug:
Modify an information message.
labelopt:
Clean up an export an internal predicate for value numbering. Replace
bintree_set with set.
middle_rec:
Prepare for the generalization of middle recursion optimization
to include predicates with an if-then-else structure.
cse_detection:
Fix a bug: when hoisting a common desconstruction X = f(Yi), create
new variables for the Yi. This avoids problems with any of the Yis
appearing in other branches of the code.
goal_util:
Add a new predicate for use by cse_detection.
common:
Fix a bug: recompute instmap deltas, since they may be affected by the
optimization of common structures.
code_info:
Make an error message more explicit.
det_analysis:
Restrict import list to the needed modules.
*.m:
Import assoc_list.
code_exprn.m, modes.m:
Fix singleton variable warnings by deleting useless code.
shapes.m, typecheck.m:
Fix singleton variable warnings by renaming variables so that they
start with an underscore.
make_hlds.m:
Pass the context down into transform_goal_2, unravel_unification,
insert_arg_unifications, and append_arg_unifications, so that
the goal_info_context in the newly built HLDS is never empty.
This is needed because the new warn_singletons uses the context,
so it has to be valid.
unify_proc.m:
Pass a term__context to unravel_unification (as required by
above change).
quantification.m:
Rearrange some comments that got shifted a dozen
lines from the code they referred to.
vn_util.m:
Fix omission in Zoltan's changes with `succip(FramePointer)'
which caused "Software Error: unexpected lval in vn_...".
modes.m:
Optimize away unifications with dead variables.
(The code generator already does that, but by
that time we have already allocated unnecessary
stack slots for them.)
code_exprn.m:
Avoid generating sequences such as `r2 = r3; r3 = r2;'
when a register already contains the correct value.
(This change was in fact at least as much Tom's work as mine.)
store_alloc.m:
For disjunctions, we only want to allocate registers
for the variables that are output by the disjunction.
The inputs should go in framevars, not in registers.
This avoids much of the register-shuffling
in the code generated for e.g. list__member(out, in).
(This change was in fact at least as much Tom's work as mine.)
frameopt:
Look inside blocks introduced by value numbering when looking
restorations of succip.
value_number, opt_util:
If we are using conservative garbage collection, disable value
numbering for blocks that allocate more than one cell on the heap.
This allows value numbering of most blocks to work in the absence
of -DALL_INTERIOR_POINTERS.
all other source files:
Clean up "blank" lines that nevertheless contain space or tab
characters.
code_exprn.m:
Double bug fix. Static ground terms were not being correctly
handled. Neither were partially instantiated terms. Both are
now handled correctly (famous last words, no doubt).
det_analysis.m:
I thought I'd committed this change at *least* once before
(though I havn;t checked the revision history). I fixed the
code generator bug that was causing a commented out section
to fail. So I've uncommented out that section.
code*.m & *gen.m:
Implement an improved method of handling negated contexts.
The new method avoids saving things onto the stack before
an if-then-else or negation if it can.
Also, fix the implementation of nondet if-then-else so that
it does the soft cut properly.
code_exprn.m:
Fix a bug that was causing the code generator to loose
track of how many references there are to a register.
The bug was what caused incorrect results for one of
Bart's programs.
compiler/*:
Add copyright messages.
Change all occurences of *.nl in comments to *.m.
compiler/mercury_compile.pp:
Change the output to the .dep files to use *.m rather than *.nl.
(NOTE: this means that `mmake' will not work any more if you
call your files *.nl!!!)
code_exprn.m
code_info.m:
Fix an overly conservative sanity check.
mercury_compile.pp
typecheck.m:
Fix type errors due to the changed implementation of map.
Possibly these bits of code should be removed or something
so that map is properly abstract.
exprn_aux.nl:
a new module for manipulating rvals and lvals.
code_exprn.nl:
the new bottom level of the new code generator. This replaces
a large chunk of code_info.
*code* & *gen*:
various small changes to use the new bottom level of the
code generator.