Re: Lexicals, continuations, and register allocation

2004-11-30 Thread Dan Sugalski
At 7:20 PM +0100 11/30/04, Thomas Seiler wrote: At Tue 30 Nov 6:22pm, Dan Sugalski wrote: Architecture changes aren't an option we're entertaining until after we're functionally complete. Just would like to ask a related question: Is a change that invalidates an existing precompiled bytecode but

Re: Lexicals, continuations, and register allocation

2004-11-30 Thread Thomas Seiler
At Tue 30 Nov 6:22pm, Dan Sugalski wrote: > Architecture changes aren't an option we're entertaining until after we're > functionally complete. Just would like to ask a related question: Is a change that invalidates an existing precompiled bytecode but not the source code of it considered as an ar

Re: Lexicals, continuations, and register allocation

2004-11-30 Thread Dan Sugalski
At 5:30 PM +0100 11/30/04, Leopold Toetsch wrote: Dan Sugalski <[EMAIL PROTECTED]> wrote: At 9:15 PM +0100 11/23/04, Leopold Toetsch wrote: Below inline/attached are some thoughts WRT the subject. leo Lexicals, continuations, and register allocation 1) Recent discussions have shown t

Re: Lexicals, continuations, and register allocation

2004-11-30 Thread Matt Fowles
> >> > >>leo > >> > >> > >>Lexicals, continuations, and register allocation > >> > >>1) Recent discussions have shown that we obviously can't handle all > >>the side effects of continuations correctly. Reusing preserved > >

Re: Lexicals, continuations, and register allocation

2004-11-30 Thread Leopold Toetsch
Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 9:15 PM +0100 11/23/04, Leopold Toetsch wrote: >>Below inline/attached are some thoughts WRT the subject. >> >>leo >> >> >>Lexicals, continuations, and register allocation >> >>1) Recent discus

Re: Lexicals, continuations, and register allocation

2004-11-30 Thread Matt Fowles
Dan~ On Tue, 30 Nov 2004 10:22:29 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 9:15 PM +0100 11/23/04, Leopold Toetsch wrote: > > > >Below inline/attached are some thoughts WRT the subject. > > > >leo > > > > > >Lexicals, cont

Re: Lexicals, continuations, and register allocation

2004-11-30 Thread Dan Sugalski
At 9:15 PM +0100 11/23/04, Leopold Toetsch wrote: Below inline/attached are some thoughts WRT the subject. leo Lexicals, continuations, and register allocation 1) Recent discussions have shown that we obviously can't handle all the side effects of continuations correctly. Reusing preserved

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Bill Coffman <[EMAIL PROTECTED]> wrote: >> two possible interferences of different kinds, with additional coding >> overhead ... > ... What makes it a > little complicated is how do these "ubiquetous" symbols interact with > the non-ubuiquitous? Those arcs are needed for this. Yes that's what

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Chromatic <[EMAIL PROTECTED]> wrote: > On Wed, 2004-11-24 at 15:04 +, Nicholas Clark wrote: >> Quite a lot of us would just like parrot COMPLETE and CORRECT before >> starting to put a lot of effort into how fast it is. > I'd settle for it compiling (#32514). Well, having just a short look a

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Matt Fowles <[EMAIL PROTECTED]> wrote: > On Wed, 24 Nov 2004 17:25:05 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: >> a = b + c + foo() > I am not sure that they are as rare as you think. Does it matter? They are no lexicals, you can't refetch them. So they get a distinct storage. When f

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread chromatic
On Wed, 2004-11-24 at 15:04 +, Nicholas Clark wrote: > Quite a lot of us would just like parrot COMPLETE and CORRECT before > starting to put a lot of effort into how fast it is. I'd settle for it compiling (#32514). If not for the broken build, I'd have poked at three or four small TODO ite

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Bill Coffman
On Wed, 24 Nov 2004 09:39:27 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Bill Coffman wrote: > > On Tue, 23 Nov 2004 23:26:39 +0100, Leopold Toetsch <[EMAIL PROTECTED]> > > wrote: > > > Keep in mind that you don't actually have to add all those CFG edges. > > You already know precisely th

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Matt Fowles
Leo~ On Wed, 24 Nov 2004 17:25:05 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Matt Fowles <[EMAIL PROTECTED]> wrote: > > Leo~ > > > On Wed, 24 Nov 2004 16:42:31 +0100, Leopold Toetsch <[EMAIL PROTECTED]> > > wrote: > >> And as a side effect it will make Dan's evils subs compile, because

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Matt Fowles <[EMAIL PROTECTED]> wrote: > Leo~ > On Wed, 24 Nov 2004 16:42:31 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: >> And as a side effect it will make Dan's evils subs compile, because >> long-lived lexicals already have their storage aka register. Only temps >> need a register alloca

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Matt Fowles
Leo~ On Wed, 24 Nov 2004 16:42:31 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > And as a side effect it will make Dan's evils subs compile, because > long-lived lexicals already have their storage aka register. Only temps > need a register allocated. What happens to temps that need to cross

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Nicholas Clark <[EMAIL PROTECTED]> wrote: > On Wed, Nov 24, 2004 at 09:45:27AM -0500, Ken Fox wrote: >>As long as an architecture change is on the >> table, might as well make it a doozy. > Quite a lot of us would just like parrot COMPLETE and CORRECT before > starting to

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Nicholas Clark <[EMAIL PROTECTED]> wrote: > I'm probably going to get shot for suggesting this, but if each interpreter > has a count of the number of full continuations invoked (ie non-return > continuations), then I think that we can know when we *haven't*. Nobody gets shot - and - interesting

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Ken Fox <[EMAIL PROTECTED]> wrote: > Leopold Toetsch wrote: >>+-+--+ >>| ctp | interpreter state| >>+-+--+ >> | >> ++ >>| >> +--+-+---+--+ >> |

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Nicholas Clark
On Wed, Nov 24, 2004 at 09:45:27AM -0500, Ken Fox wrote: >As long as an architecture change is on the > table, might as well make it a doozy. Quite a lot of us would just like parrot COMPLETE and CORRECT before starting to put a lot of effort into how fast it is. PLEASE c

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Ken Fox
Leopold Toetsch wrote: +-+--+ | ctp | interpreter state| +-+--+ | ++ | +--+-+---+--+ | prev | ctx | lexicals | volatiles| +-

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Nicholas Clark
On Wed, Nov 24, 2004 at 09:39:27AM +0100, Leopold Toetsch wrote: > Bill Coffman wrote: > >Another interesting thing about this problem is that these new CFG > >edges are rarely, or at least with low probability, ever travelled. > > We just don't know it, rare or not doesn't matter. I'm probably

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Miroslav Silovic
Leopold Toetsch wrote: Sure. But I've no confirmation of a compiler writer that its possible. Annotating PIR can only work for nested closures. If libraries are involved you are out of luck. And we have such code already in library/Streams/Sub.imc. I've been thinking of what could be implemented

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Bill Coffman wrote: On Tue, 23 Nov 2004 23:26:39 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: Keep in mind that you don't actually have to add all those CFG edges. You already know precisely the effects of adding them. All non-volatile symbols (those crossing subs that might make continuati

Re: Lexicals, continuations, and register allocation

2004-11-24 Thread Leopold Toetsch
Matt Fowles <[EMAIL PROTECTED]> wrote: > Leo~ > On Wed, 24 Nov 2004 04:55:24 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: >> I've clearly stated that lexicals aka non-volatiles have distinct >> registers. > Thus for these large subs, won't this be a large overhead? Why? It's actually less

Re: Lexicals, continuations, and register allocation

2004-11-23 Thread Bill Coffman
On Wed, 24 Nov 2004 04:55:24 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Matt Fowles <[EMAIL PROTECTED]> wrote: > > ... However, if a continuation restores registers to the data they > > had when the continuation was taken, then all of the registers will > > contain the things that exactly

Re: Lexicals, continuations, and register allocation

2004-11-23 Thread Bill Coffman
On Tue, 23 Nov 2004 23:26:39 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Matt Fowles wrote: > > > Have we seen that this actually destroys us? Meaning, if we add the > > extra CFG arcs, do we start spilling like mad? If not, this is much > > ado about nothing. > > Please first have a lo

Re: Lexicals, continuations, and register allocation

2004-11-23 Thread Matt Fowles
Leo~ On Wed, 24 Nov 2004 04:55:24 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Matt Fowles <[EMAIL PROTECTED]> wrote: > > > Won't your approach put every one of those things in its own register? > > I've clearly stated that lexicals aka non-volatiles have distinct > registers. Thus for t

Re: Lexicals, continuations, and register allocation

2004-11-23 Thread Leopold Toetsch
Matt Fowles <[EMAIL PROTECTED]> wrote: > Won't your approach put every one of those things in its own register? I've clearly stated that lexicals aka non-volatiles have distinct registers. > ... However, if a continuation restores registers to the data they > had when the continuation was taken

Re: Lexicals, continuations, and register allocation

2004-11-23 Thread Matt Fowles
Leo~ On Tue, 23 Nov 2004 23:26:39 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Matt Fowles wrote: > > > Have we seen that this actually destroys us? Meaning, if we add the > > extra CFG arcs, do we start spilling like mad? If not, this is much > > ado about nothing. > > Please first hav

Re: Lexicals, continuations, and register allocation

2004-11-23 Thread Leopold Toetsch
Matt Fowles wrote: Have we seen that this actually destroys us? Meaning, if we add the extra CFG arcs, do we start spilling like mad? If not, this is much ado about nothing. Please first have a look at Dan's recent posting about Evil Sub. Then estimate, how many subs may be called in 14000 basic

Re: Lexicals, continuations, and register allocation

2004-11-23 Thread Matt Fowles
Leo~ On Tue, 23 Nov 2004 21:15:33 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Below inline/attached are some thoughts WRT the subject. > > leo > > > Lexicals, continuations, and register allocation > > 1) Recent discussions have shown that we obvious

Lexicals, continuations, and register allocation

2004-11-23 Thread Leopold Toetsch
Below inline/attached are some thoughts WRT the subject. leo Lexicals, continuations, and register allocation 1) Recent discussions have shown that we obviously can't handle all the side effects of continuations correctly. Reusing preserved (non-volatile) registers after a call isn't po