[m-rev.] for review: --eliminate-local-vars

Peter Ross peter.ross at miscrit.be
Thu Feb 7 22:15:48 AEDT 2002


fjh wrote:
> Estimated hours taken: 12
> Branches: main
>
> Add a new MLDS->MLDS optimization option, --eliminate-local-variables.
> The aim of this pass is to improve performance in cases where local
> variables are costly -- for nondeterministic procedures,
> for MLDS->C accurate GC, and for the .NET back-end.
>
> compiler/ml_optimize.m:
> Add a pass to eliminate local variables.
> Also, don't optimize tail calls unless --optimize-tailcalls is set.
>
> compiler/mercury_compile.m:
> Invoke the ml_optimize pass once before ml_elim_nested
> (with --optimize-tailcalls disabled), as well as once after it.
>
> compiler/options.m:
> doc/user_guide.texi:
> Add an option --eliminate-local-variables to enable the new
> optimization.
>
> compiler/ml_elim_nested.m:
> compiler/ml_util.m:
> Move statement_contains_var and definition_contains_var
> from ml_elim_nested.m to ml_util.m, for use by ml_optimize.m.
>
> compiler/ml_elim_nested.m:
> - Handle local variables with initializers; this is neccessary
>   now that ml_optimize gets run before ml_elim_nested.
> - Don't allocate a stack frame struct and link it into the chain
>   if there are no local variables that contain pointers.
> - In fixup_atomic_statement, handle foreign_proc_code more
consistently.
> - Add some comments.
>
apart from the comments, this looks fine.

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list