[m-dev.] Reuse question

Peter Ross petdr at miscrit.be
Tue Oct 3 20:53:58 AEDT 2000


On Tue, Oct 03, 2000 at 08:38:44PM +1100, Fergus Henderson wrote:
> On 03-Oct-2000, Peter Ross <petdr at miscrit.be> wrote:
> > On Tue, Oct 03, 2000 at 11:21:58AM +1100, Fergus Henderson wrote:
> > > On 02-Oct-2000, Peter Ross <petdr at miscrit.be> wrote:
> > > > On Mon, Oct 02, 2000 at 04:08:20PM +0200, Peter Ross wrote:
> > > > > On Mon, Oct 02, 2000 at 06:38:33AM -0700, Ralph Becket wrote:
> > > > > > How low-level does the reuse analysis go?  It would be nice if, when
> > > > > > mapping over a list of cells that are then up for reuse, the list cells
> > > > > > were updated in place.
> > > > > > 
> > > > > Yes the current analysis detects that there is reuse available there
> > > > > provided that the original list is never needed again.
> > > > 
> > > > I lied the current analysis doesn't mark it for reuse because the
> > > > predicate contains an higher order call.  Higher order calls are
> > > > currently handled by setting the possible aliasing to top (everything is
> > > > possibly aliased with everything else).
> > > 
> > > If you compile with appropriate optimization enabled (e.g.
> > > -O6 --intermodule-optimization), the compiler should specialize
> > > the code for list__map, and convert the higher-order call into a first-order
> > > call.
> > > 
> > > Is reuse analysis getting done before higher-order specialization?
> > > 
> > Reuse analysis is the last operation of the middle_pass.
> 
> OK, so why doesn't the current reuse analysis mark it for reuse?
> Or did your test fail just because you didn't enable full optimization?
> 
I was mistaken (Nancy wasn't here when I replied to these email
messages) about my reasoning for why the reuse wasn't noticed.  The
higher-order call occurs after the deconstruction so we can safely
assume that the only aliasing is the possible aliasing amongst the head
vars at the deconstruction, so the deconstruction becomes available for
reuse provided that there is no aliasing involving HeadVar__1.

Nancy and I are attempting to track down what the problem is now.

Peter
--------------------------------------------------------------------------
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