[MLton] profiling question

Stephen Weeks MLton@mlton.org
Fri, 19 Mar 2004 10:43:45 -0800


> Perhaps one way to work around all these problems is to insert a
> Runtime call in the SSA to do the increment, in between the
> ProfileEnter and ProfileLeave.

This is a bad idea, since the inserted call will then interfere with
subsequent optimizations.

I think the right observation is that you need to wrap the Profile
Enter/Leave around something that you want to measure.  If the
simplifier makes that something go away, then it will make the
Enter/Leave go away.  In your case, perhaps that something should be a
tuple allocation, or a sequence of statements that does a coercion.