[m-dev.] for review: make tailcall loops an MLDS transformation
Tyson Dowd
trd at cs.mu.OZ.AU
Tue Aug 22 14:30:18 AEST 2000
On 22-Aug-2000, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 22-Aug-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > compiler/ml_optimize.m:
> > New file that performs MLDS->MLDS optimizations such as turning
> > self-tail calls into loops.
>
> Having one file for all MLDS->MLDS optimizations will probably prove too
> constraining. If I were you, I'd move the tailcall optimization into a separate
> file (e.g. ml_tailcall.m), and have ml_optimize.m invoke ml_tailcall.m.
> Then later you can add other optimizations in other files and just add
> invocations of them to ml_optimize.m. This obeys the principle of separation
> of concerns, and limits the sizes of source files. Optimize.m works this way
> for the LLDS back end, and it has proven quite useful.
I should have prefaced this diff by saying that I realize the file
organization is sub-optimal, but ml_tailcall was already used to do
tailcall marking.
The marking and optimization should probably be done all at once in a
single pass that works as you say. I can put a clear notice in the
comments advocating such a change. I'd prefer not to have to make such
changes right now, because this makes my job of merging the changes from
the other branch more difficult, and I'm trying to minimize the chance
of making a mistake. Moving code is one of the most error prone ways to
introduce merging mistakes.
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list