[MLton-devel] linearity related optimizations

Suresh Jagannathan suresh@cs.purdue.edu
Tue, 19 Nov 2002 16:55:37 -0500


I'm curious about thoughts on the benefit of linearity-related
optimizations in light of Stephen's new RSSA spec.  

Consider an analysis that determines a boxing criteria for every 
heap-allocated object based on the intuition that a value is boxed if it has 
at least 2 outstanding references *at any given instant*.  This means that an 
object may in fact during its lifetime be referenced by many different 
objects; provided that not more than 1 reference exists at any given point, 
this  object can take on an unboxed representation.

So, in the contrived example,

let val x = (a,b)
    fun g( (a,b), z) = if odd? z
                              then a
                            else b
    fun f (z) = g (x,z)
    val h = f 13
    val j = f 14
in h + j
end

x would be a candidate for an unboxed representation.  Unfortunately,
a typical linear type system, or a system similar to Turner, Wadler
and Mossin's use-types would say otherwise.  These transformations appear to 
be orthogonal to flattening transformations, but there may well be underlying 
similarites.

I'm wondering whether there's likely to be substantial benefit to such 
transformations in the new RSSA world that represents objects via
memory chunks, and whether it's worth exploring the application (suitably
modified) of linearity-based analyses on an RSSA target.

-- sj



-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel