[LLVMdev] Creating an LLVM backend for a very small stack machine

Wesley J. Landaker wjl at icecavern.net
Tue Feb 24 15:36:18 PST 2009


On Tuesday 24 February 2009 07:49:17 Mark Shannon wrote:
> Regarding access to the source code;
> I would send you the code, but I might be stepping on a few toes.
> The person to speak to is Chris Bailey at the University of York (in the
> UK).
>
> However it is written for the lcc tree-based IR, rather than the
> SSA-based IR of LLVM, so I don't think it will be that much use.
>
> A lot of the analysis it does is to find information that is explicit in
> the SSA form anyway, such as generating a flow graph.

That's okay, I wasn't sure it would be much use either; mostly I was just 
curious and thought maybe I could learn something from it if it was readily 
available.

> The SSA form already provides a head start for chosing stack allocation
> candidates. For example, PHI-nodes are obvious candidates for edges in
> the flow-graph.

I'm a fan of SSA already (used it a bit in a hardware synthesis context), 
but this is my first attempt to use it an LLVM context, or to target a 
stack machine. I guess I'll see how it goes.

> I would be interested to see how good SSA-form is for stack allocation,
> as that was my intended direction if I had stayed longer at York.

I hope to eventually get to this on my project. For my first cut I'm going 
to do a rather dumb allocation just to get things working. In my niche, 
most programs for this machine will be under 256 (!) instructions, and 
speed doesn't matter much. So on one hand, if it fits, optimizations don't 
matter much. But on the other hand, it has to fit! =)

-- 
Wesley J. Landaker <wjl at icecavern.net> <xmpp:wjl at icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090224/238b8dc3/attachment.sig>


More information about the llvm-dev mailing list