[MLton-devel] -profile time and the native codegen

Matthew Fluet fluet@CS.Cornell.EDU
Sat, 18 Jan 2003 15:31:55 -0500 (EST)

> Matthew, I was wondering about a possible imprecision in time
> profiling introduced by the native codegen.  When compiling -profile
> time, the type checker for Machine makes sure that all blocks (except
> for those of Kind.Func) begin with a ProfileLabel.  I was wondering
> though, what happens with new blocks created by the native codegen.

I'm pretty sure that the only new blocks created by the native-codegen are
register allocation compensation blocks (which essentially do nothing more
than shuffle values around).  This didn't used to be the case before
Arith, Runtime, and CCalls were transfers.

> Will those mostly fall in the right place?

Not always.  Most of them should be layed out right after the transfer for
which they compensate.  But, jump tables and if branches have the
possibility that the compensation block is written somewhere away from
either the transfer or the target.

> How difficult would it be
> to add a ProfileLabel to such blocks (and modify the labels in
> profileInfo)?

I don't know.  For each new block I create, I can identify a block that
it's profile info should be equivalent to (i.e., I should be able to
extract an existing ProfileLabel).  You would know better than I how
difficult it is to modify an existing ProfileInfo to include a new
ProfileLabel equivalent to an existing one.

The down side is that we won't know all the new ProfileLabel's until after
generating all the asm, which delays producing the C stub.

This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will
allow you to extend the highest allowed 128 bit encryption to all your 
clients even if they use browsers that are limited to 40 bit encryption. 
Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en
MLton-devel mailing list