[mercury-users] Flattening (was: maybe(T))
Zoltan Somogyi
zs at cs.mu.OZ.AU
Mon Oct 21 16:47:27 AEST 2002
On 21-Oct-2002, Michael Day <mikeday at yeslogic.com> wrote:
> I get the feeling though that type flattening would require marshalling
> whenever the flattened structure had to be passed to a predicate expecting
> the generic one though, which would probably kill any benefits, or at
> least make it very difficult to identify when the optimisation would be
> beneficial.
Bingo. The transformation is relatively easy. Being able to tell whether it
is an optimization or a pessimization is very hard, and in most cases the
program itself doesn't have enough information for a reliable decision.
The transformation is not worth implementing unless the compiler has access
to profiling information which it can plus into its cost formulas. We don't yet
have a facility for feeding back profiling information to compiler, but I am
working on one.
Zoltan.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list