[Top][All Lists]

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

Re: CPS and RTL

From: Noah Lavine
Subject: Re: CPS and RTL
Date: Thu, 24 Jan 2013 23:38:58 -0500

The push is complete. If I'm not mistaken, you should now see a wip-rtl-cps branch with a Tree-IL->CPS compiler. The compiler is used in cps.test. Please let me know if I did anything wrong.


On Thu, Jan 24, 2013 at 11:03 AM, Noah Lavine <address@hidden> wrote:

On Thu, Jan 24, 2013 at 10:12 AM, Andy Wingo <address@hidden> wrote:

On Thu 24 Jan 2013 14:50, Noah Lavine <address@hidden> writes:

> Thanks for the review! There has actually been more progress since I
> pushed that branch. I hit a point in the CPS->RTL stuff where I had
> trouble because I didn't know how to do things (like mutable variables)
> in RTL. So I've actually ported the compiler to GLIL in a branch on my
> computer. I also have a working Tree-IL->CPS compiler for some of
> Tree-IL (it's not done yet).
> I thought that might be a better way forward because CPS and RTL are, to
> a certain extent, separate ideas.

Cool, please push so we can see.

Given the rest of your email, maybe I'll move the Tree-IL->CPS compiler back to wip-cps-rtl branch and push that.
Honestly I think RTL and CPS go together very well.  CPS is all about
giving a name to everything, but that can be inefficient in a stack VM,
because referencing and updating named variables requires separate push
and pop instructions.  RTL makes this easy and cheap.

Yes, I hadn't thought about that. RTL does make sense.
Regarding mutable variables: we probably still need to box them in
general because of call/cc.  There are cases in which they can be
unboxed, but I think that store-to-load forwarding with DCE can probably
recover many of those cases.  Dunno.  I would box them as part of an
assignment conversion pass.

I think I was imagining about the same thing you're thinking.
> I realize it might be confusing to start with CPS->RTL, then switch to
> CPS->GLIL, then switch back later when the RTL branch is ready. If you'd
> rather do it that way, we can skip the CPS->GLIL phase.

Personally I would prefer to target RTL.  But that is a personal opinion

I'm happy to! You've convinced me that it's better. I see that you just implemented toplevel-refs, too, so my problem is solved.


reply via email to

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