local refs
Stephen Weeks
MLton@sourcelight.com
Mon, 10 Dec 2001 10:38:47 -0800
> Out of 1101 top level SSA functions, 126 has flattenable refs.
...
Interestingly, we occasionally get things like:
> x_208258 LocalRefs: [plists_92: {reff = Some ((L_114603, list_85)),
> assigns = [L_114600, L_114569],
> derefs = [L_114601, L_114569],
> locall = local,
> threadCopyCurrent = {assign = false,
> deref = false}}]
> x_208258 Violations: (plists_92)
>
> which looks like something to do with property-lists.
Yeah, this is cool. It is from a property that has the "destroy"
capability. plists is a list ref maintaining the list of property
lists on which the property has been stored. This is quite possibly
the extract function in ssa/shrink.fun, which is small enough that one
could believe that all the uses of the property are in a single
control-flow graph.
> This one is cute:
...
> It's basically turning nested List.foreach and Vector.foreach into the
> appropriate folds:
Neat.
> If you've made it this far, here's a little more good news. I tried
> replacing the once pass in constantPropagation, by replacing
> val once = Once.once program
> with
> val {varIsMultiDefed, ...} = Multi.multi program
> val once = not o varIsMultiDefed
>
> No problems on any of the regressions. I don't know if it's really doing
> anything different.
The old once pass assumed all functions other than main were
multiUsed, so there is the possibility that Multi.multi is doing
something different. I vote for removing the old once pass, replacing
the use with this, and renaming once.sml to multi.sml.