Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Register spilling needs a last-gasp give-up scheme
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan Sugalski  
View profile  
 More options May 24 2004, 3:33 pm
Newsgroups: perl.perl6.internals
From: parrotbug-follo...@parrotcode.org (Dan Sugalski)
Date: Mon, 24 May 2004 12:33:30 -0700
Local: Mon, May 24 2004 3:33 pm
Subject: [perl #29837] Register spilling needs a last-gasp give-up scheme
# New Ticket Created by  Dan Sugalski
# Please include the string:  [perl #29837]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=29837 >

It's possible to get the register allocator in what is essentially an
infinite loop, where it runs forever or until it blows memory and
dies. It needs to have a means to check for too many iterations and
fall back to a slow-but-working version with too much spilling.
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 25 2004, 3:43 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Tue, 25 May 2004 09:43:39 +0200
Local: Tues, May 25 2004 3:43 am
Subject: Re: [perl #29837] Register spilling needs a last-gasp give-up scheme

Dan Sugalski <parrotbug-follo...@parrotcode.org> wrote:
> It's possible to get the register allocator in what is essentially an
> infinite loop, where it runs forever or until it blows memory and
> dies. It needs to have a means to check for too many iterations and
> fall back to a slow-but-working version with too much spilling.

Ok. After some (useless) spill iterations, the strategy could be to just
spill everything in one run and be done with it. But this is a bit
suboptimal.

A better strategy would be to discard the life range of lexicals and
globals and emit only a fetch for these variables. But that needs some
HLL (or programmer) support for denoting lexicals and globals, e.g.

  .lexical "foo"
  .global pmc bar   # current syntax but unimplemented

I'm not quite sure, if the current C<.global> syntax is useful (it
allows non-PMC types). Anyway, if imcc knows, that the variable is a
global or lexical, the register allocator can do a better job.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Sugalski  
View profile  
 More options May 25 2004, 9:07 am
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Tue, 25 May 2004 09:07:39 -0400
Local: Tues, May 25 2004 9:07 am
Subject: Re: [perl #29837] Register spilling needs a last-gasp give-up scheme
At 9:43 AM +0200 5/25/04, Leopold Toetsch wrote:

>Dan Sugalski <parrotbug-follo...@parrotcode.org> wrote:

>>  It's possible to get the register allocator in what is essentially an
>>  infinite loop, where it runs forever or until it blows memory and
>>  dies. It needs to have a means to check for too many iterations and
>>  fall back to a slow-but-working version with too much spilling.

>Ok. After some (useless) spill iterations, the strategy could be to just
>spill everything in one run and be done with it. But this is a bit
>suboptimal.

True, but less sub-optimal than running until you hit an
out-of-memory condition or give up with a double spill error. :)

>A better strategy would be to discard the life range of lexicals and
>globals and emit only a fetch for these variables. But that needs some
>HLL (or programmer) support for denoting lexicals and globals, e.g.

>   .lexical "foo"
>   .global pmc bar   # current syntax but unimplemented

I can see that helping in some circumstances (though not mine) but
the code that the register allocator's having fits with has no .local
declarations at all. It's all $x register usage from beginning to end.
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 25 2004, 10:29 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Tue, 25 May 2004 16:29:25 +0200
Local: Tues, May 25 2004 10:29 am
Subject: Re: [perl #29837] Register spilling needs a last-gasp give-up scheme

Dan Sugalski <d...@sidhe.org> wrote:
> I can see that helping in some circumstances (though not mine) but
> the code that the register allocator's having fits with has no .local
> declarations at all. It's all $x register usage from beginning to end.

Don't you have something like variables, which could be stored as
globals?

If you code looked like ...

  $Px = global "foo"
  # some temps
  $Px += temp

... it would automatically cut down the life range of $Px.

One more remark: do you use the same "$Px" in different places (for
different temps/vars) or do you increase "x" for different temps? The
latter should be much better.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Sugalski  
View profile  
 More options May 25 2004, 11:20 am
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Tue, 25 May 2004 11:20:02 -0400
Local: Tues, May 25 2004 11:20 am
Subject: Re: [perl #29837] Register spilling needs a last-gasp give-up scheme
At 4:29 PM +0200 5/25/04, Leopold Toetsch wrote:

Yes, I know. I've done that. Everything is in globals, everything is
fetched only when actually needed, and only lives for the duration of
the basic block. (The compiler keeps a cache and flushes it every
label)

>One more remark: do you use the same "$Px" in different places (for
>different temps/vars) or do you increase "x" for different temps? The
>latter should be much better.

I do the latter. There's no reuse of the $Px temps for different values.
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »