nullary FFI's

Matthew Fluet fluet@CS.Cornell.EDU
Thu, 31 Aug 2000 19:43:07 -0400 (EDT)


Here's some thing interesting that came now that I have rudimentary
floating-point working (more to come on this in a few days; it's very
rough right now).  In the tensor.sml benchmark, the C-backend generates
the following code:

case main_0_index:
/* live: [] */
	LimitCheck(12, L_200, 0, StackOverflowCheck);
	SU(4) = L_1_index;
	SaveExnStack(4);
	Real_Math_e;
	Real_Math_pi;
	SP(16) = GP(0);
	Push(12);
	SI(0) = L_11_index;
	goto contains_0;

What's interesting about this is the fact that the nullary FFI's aren't
doing anything.  I tried rigging prim.fun to get nullary FFI's to be
considered functional, but that didn't get rid of them.

Anyways, this came up because my translation from MachineIL was assuming
that all FFI prims that were nullary had a destination.  It's easy enough
to generate nothing for the case of a nullary FFI with no destination, but
I would think that some simplifier further back could also take care of
it.