Hi, On Mon 20 May 2013 00:06, l...@gnu.org (Ludovic Courtès) writes:
>> Once the RTL branch is all merged in, we can start doing the same with >> Noah's wip-rtl-cps branch. > > I’m unclear on what the safest or easiest approach is. My natural > tendency would have led me to start by “just” rewriting the > GLIL->assembly pass, and only then go with the fancy CPS compiler. > But I gather that the CPS compiler may facilitate the conversion to > assembly. > > What’s your take on this? Dunno. So GLIL is a pretty useless layer that won't have much purpose in any RTL compiler I think. The RTL assembler and linker provide some of the facilities of GLIL like handling constants and meta-data, so I think it's reasonable to go directly from tree-il or CPS to RTL. One thing that would be possible would be a conversion to ANF -- still tree-il, but with names for all temporary values -- then you run the existing "analyze" pass that allocates local slots, and you hack the tree-il->glil compiler to become a tree-il->rtl compiler. That's probably the lowest-risk thing to do. But it is also a shame in some ways, and still has some unknowns. I'll start working with Noah's code soon and give a better impression then. Cheers, Andy -- http://wingolog.org/