tensor

Stephen Weeks sweeks@wasabi.epr.com
Mon, 18 Oct 1999 11:32:30 -0700 (PDT)


>    I'm confused about CpsKnown and CpsUnknown.  What do they count?
>    Where are they incremented?  I looked through the source and couldn't
>    find them.  The instrumentation for following variables is in
>    cps/loop-count.fun: CpsLoop, CpsCall, CpsDispatch, CpsCoerce.  Do you
>    have any examples where CpsKnown or CpsUnknown is nonzero?
> 
> I found references to them closure-convert/closure-convert.fun.

Yes, they are there, but I see that they are unused.  I took a look at 
an old snapshot, and here is how they used to get used.  In the apply
function (around line 400), let "result" be the case expression that
is currently there, and put the following after.  Who knows, maybe it
will work.

	    fun inc prim =
	       Cexp.seq(Cexp.primApp{prim = prim, targs = [], args = [],
				     ty = Ctype.unit},
			result)
	 in if !Control.instrument
	       then (case cons of
			[] => result
		      | [_] => inc incKnownCount
		      | _ => inc incUnknownCount)
	    else result
         end