On Sat, Mar 1, 2008 at 9:20 AM, Michele Simionato
<[EMAIL PROTECTED]> wrote:

>  I am just curious to know which optimization I am breaking and
>  why the compiler cannot be smart enough. Any idea?

In the first case, the compiler can see that all references to fac
are call sites: the value of "fac" is only used in positions where
the compiler can be absolutely sure it is a call. In the second case
the value of fac is passed to "call" (and the compiler is not clever
enough to trace the value through the execution of "call" - this
would need flow analysis). So in the first case, a specialized
representation of fac can be used ("direct" lambdas, i.e. direct-style
calls which are very fast).

Compiling with "-debug o" and/or "-debug 7" can also be very instructive.


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to