[MLton-devel] profiled self compile with source info

Stephen Weeks MLton@mlton.org
Thu, 12 Dec 2002 22:26:56 -0800


> > The results are a bit weird because only source lambdas that make it
> > as SSA functions are tracked, so a lot is missed due to inlining and
> > contification.  I'm working on that.
> 
> What are you planning on doing?

Here is my current plan.

Add the following to Ssa.Statement.t

	 Enter of SourceInfo.t
       | Leave

Then, before the Ssa simplification, put an Enter statement at the
beginning of each Ssa function and a Leave statement before each
Raise, Return, and Tail call.  All of the optimization passes will
pretty much pass these through unchanged.  Perhaps I will add stuff to
eliminate useless Enter/Leave pairs that don't have any real
statements in them and something to turn a nontail call followed by a
Leave and Return into a Leave followed by tail call.

In any case, the point is that even after inlining, with Enter/Leave
information it is possible to figure out at each program point what
the current function is (in fact we can tell what the current "local"
stack is much like we do for exception handlers).  With this
information, I plan to add a pass in the backend at the end of the
Rssa pipeline that inserts a Profile statement (with some uniqifying
information) at the beginning of each basic block and each Enter/Leave
within a basic block.  The native codegen will simply have to insert a
label at each of these Profile statements.

The Rssa pass will also create auxiliary profiling information to map
the uniqifying info to (sequences of) source lambdas that mlprof can
use, much as is done now (with the recent checkins).


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel