[pypy-dev] CLI code generation (was: Svn account?)

holger krekel hpk at trillke.net
Mon Mar 20 14:39:48 CET 2006


Hi Armin, Antonio, 

On Mon, Mar 20, 2006 at 14:21 +0100, Armin Rigo wrote:
> On Mon, Mar 20, 2006 at 10:52:42AM +0100, Antonio Cuni wrote:
> > I think it should be fairly simple to translate from the SSA form to a 
> > more "stack-friendly" form useful for stack-based machines; the question 
> > is: where to put such code?
> > Since it could be useful even for other backends, it would be nice to 
> > put it in some place where it can be shared from several backends: one 
> > option could be to write it as a backend optimization, but in this case 
> > we have to introduce new low level operations for stack manipulation, 
> > such as 'push', 'pop' or 'dup'.
> 
> Also useful for other back-ends would be a way to reconstruct some kind
> of "expression tree".  For example, in Squeak, it is more efficient to
> generate a single complex expression instead of a lot of simple
> expressions, because of the shuffling of the local variables that the
> latter requires.  The link with your suggestion is that these complex
> expressions are also very stack-machine-friendly.

Interesting but isn't the IL code a bit too low level for that to 
make full sense?  

For generating Squeak bytecode (or Python bytecode for that
matter) it seems more obvious to me that generating (higher
level) complex expressions is worthwhile.  

> It would probably make sense to write this as a function that takes a
> single block and produces a list of "complex expression" objects -- to
> be defined in a custom way, instead of trying to push this into the
> existing flow graph model.

Hum, i think btw that changing/transforming pypy flow graphs
is often not something for the lighthearted and can get quite
involved.  But i don't see anything inherently bad with keeping
a flow graph model for the SSI->Stack operation transformation
at least for low level targets. 

best, 

    holger



More information about the Pypy-dev mailing list