[Ecls-list] Latest changes

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Jul 5 07:55:26 UTC 2009


An important one is that the code for inlining lisp forms and
replacing them with C expressions has been heavily refactored and its
logic changed. Now the code can use temporary variables which are
unboxed, avoiding consing in some cases and using the lightest
versions of the C forms which are available.

Note, however, that performance improvements will not be evident
immediately because the new logic requires a bit better inferring of
the types of expressions. More precisely, whether an expression is
unboxed is determined by the destination of the value and the type
returned by the lisp expression, an information which is currently not
always determined -- work is in progress to add type inference
routines for the Common Lisp library functions.

In addition to this I have coded a type inference phase. Currently it
is disable, because it is missing key ingredients: not all forms are
scanned and type information at the intersection of several code
branches is not properly merged. If you are interested on playing with
it, the flag is *do-type-propagation*. You can play with toy
functions, such as the fft transform in cl-bench and inspect the
generated code using (compile-file "your-lisp-file" :c-file t) A lot
of messages will be printed to the screen, because the code is still
in debug phase.

The type inference is a new phase. It runs through the intermediate
forms tree using the information that they provide and doing two
things:
- Computing the type of an expression based on its arguments. For this
the arguments are scanned in a recursive manner, doing type inference
on them.
- Keep a list with the changes of type of variables. This is only done
for local variables and it is still incomplete: since we are not
scanning certain forms (lack of time to implement it), this
information is incomplete and innacurate, but it should be very
valuable.

When the type information has been properly inferred, the new inlining
code does a better job. Have a look at the suggested example, the FFT
transform in cl-bench to get an idea.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list