Files
mercury/compiler/notes
Thomas Conway 3641af5272 Add constant propagation within modules. This occurs during simplification
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.
1997-08-25 02:25:09 +00:00
..
1995-05-30 09:28:30 +00:00
1995-05-20 15:32:40 +00:00
1994-04-12 15:15:05 +00:00