Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #25624

Re: RAFTS beyond basic blocks; handling phi

From "Alex McDonald" <blog@rivadpm.com>
Newsgroups comp.lang.forth
Subject Re: RAFTS beyond basic blocks; handling phi
Date 2013-09-11 13:10 +0100
Organization A noiseless patient Spider
Message-ID <l0pmjc$8ot$1@dont-email.me> (permalink)
References <l0neru$oj5$1@dont-email.me> <2013Sep11.125505@mips.complang.tuwien.ac.at>

Show all headers | View raw


on 11/09/2013 11:55:06, Anton wrote:

[snip] 

>>
>>Alternatively, we could have inserted a push <a> in block 1's exit and
>>avoided the phi; block 4 on entry would be ( -- ).
> 
> Yes, assuming that the original Block 2 is "!", not "z !".

Yes, my error. Only "!".

> 
>>The decision is which to choose.
> 
> If there are loop back-edges involved, always choose to put the action
> on the back edge.

OK. I presume there's a good reason for this; reduction in traffic?

> 
> Otherwise, if you don't want to do any additional analysis (and why do
> analysis for such a rare case?), choose the one that stores to memory
> ("push" in your intermediate representation); this may reduce the
> register pressure and reduce the number of phi nodes (or moves from
> phi removal before optimization).
> 
> - anton

I'm going to start with phi and see where that takes me when it comes to
phi removal and copy insertion; I'll let the resulting quality of the SSA
decide.

Since I'm going to generate for the x86, register pressure will be a
serious concern. And my first attempts at register allocation using naive
methods are pretty poor. My simple approach works OK for free+2 or +3
registers; beyond 3, the spilling becomes a horrendous cascade of
shuffling, partly because of the necessity to use specific registers for
certain operations. Some SSA reordering would help in any case, since
final virtual register references in the SSA can be a long way from their
previous references or definitions.

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-10 16:46 +0100
  Re: RAFTS beyond basic blocks; handling phi awegel@arcor.de (Alex Wegel) - 2013-09-10 23:30 +0200
    Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-11 11:35 +0100
      Re: RAFTS beyond basic blocks; handling phi Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-09-11 05:50 -0500
        Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-11 12:07 +0100
          Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-11 12:50 +0100
            Re: RAFTS beyond basic blocks; handling phi anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-09-11 14:27 +0000
  Re: RAFTS beyond basic blocks; handling phi anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-09-11 10:55 +0000
    Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-11 13:10 +0100
      Re: RAFTS beyond basic blocks; handling phi Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-11 20:33 +0200
        Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-11 19:53 +0100
          Re: RAFTS beyond basic blocks; handling phi Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-11 21:57 +0200
            Re: RAFTS beyond basic blocks; handling phi anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-09-13 13:14 +0000
        Re: RAFTS beyond basic blocks; handling phi albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-09-12 10:39 +0000
      Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-12 23:53 +0100
        Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-12 23:55 +0100
          Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-13 10:16 +0100
        Re: RAFTS beyond basic blocks; handling phi anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-09-13 13:19 +0000
          Re: RAFTS beyond basic blocks; handling phi "Alex McDonald" <blog@rivadpm.com> - 2013-09-15 20:34 +0100
      Re: RAFTS beyond basic blocks; handling phi anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-09-13 11:38 +0000

csiph-web