[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Ping

From: Camm Maguire
Subject: [Gcl-devel] Re: Ping
Date: 20 Dec 2006 15:14:54 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings! FYI, am out of the office in about an hour for one week. 

Robert Boyer <address@hidden> writes:

> Hi.  Got your message about inlining.  Just have little to say on the
> topic.  When to inline is a very deep problem that has been little
> explored as far as I know, and that means little.  The fact that it can
> now be done in GCL 2.7.0, because the sources are kept around, is
> fabulous.

Great!  I have it working in preliminary fashion, but not quite yet
ready to commit.  Current diff is saved in my home on elgin,
gcl.cvs.diff, just in case some computer malfunctions in my absense.

The advantage is the simplicity -- the function definition itself
provides both its own 'inlining/expanding macro, as well as its
type-propagator function.  There are all sorts of things we can do
here, like generating type propagators automatically.  These are
functions which further restrict the output type given a subset of the
allowed input types.  Effectively, these results can simply be cached
by the compiler for standard functions and used even when the function
is not inlined for critical type propagation.

Bootstrapping takes longer, as basic functions like length are
initially defined in lisp, etc.

The key to making this useful was a narrowing of the type system to
support `(eql ,foo) types.  remove, for example, is now defined to
test if its test is the standard 'eq 'eql, etc. at the beginning of
the loop, and switch to an inlined version if so.  GCL's compiler
before could not propagate this information when inlining even when
the test was explicitly supplied as :test 'eq.  Now even when it is
absent, the test test logic is ommited once the command line
parameters are given, making the inline worthwhile.

We are at the brink of reverse type proapagation at safety 0.  As a
preliminary step, check-type is handled specially when at the top of a
declaration form (right beneath the declarations).  This automatically
proclaims the argument type of the function for future use in reverse
type propagation, and at safety 0, effectively becomes a declare, so
that a safety one calling the check-type when inlined at safety 0
proceeds without it.  With these tools in hand, we can handle our
mapcar and member inlines in this way too.  The earlier way was a
cumbersome reimplementation of the function logic as a compiler macro,
and pulling out the constant :test arguments for special tratment by

Hope to finalize this when I return in one week.

> A first step, it seems to me, is simply to assure that the commands
> 'inline' and 'notinline' really work as ANSI says.  Even that looks
> complicated to me.  See below.


Take care,

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]