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


Groups > comp.lang.forth > #25691

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-15 20:34 +0100
Organization A noiseless patient Spider
Message-ID <l15242$eeb$1@dont-email.me> (permalink)
References <l0neru$oj5$1@dont-email.me> <2013Sep11.125505@mips.complang.tuwien.ac.at> <l0pmjc$8ot$1@dont-email.me> <l0tgkl$7k2$1@dont-email.me> <2013Sep13.151922@mips.complang.tuwien.ac.at>

Show all headers | View raw


on 13/09/2013 14:19:23,  wrote:
> "Alex McDonald" <blog@rivadpm.com> writes:
>>: foo begin + again ;
> ...
>>B[1] <1> pop           ( a )
>>B[1] <2> pop           ( a|c b )
>>B[1] <4> +   <2> <3>   ( c )
>>B[1] <3> phi <1> <4>   ( a|c )
>>B[1]     jmp <2>
> 
> Yes, since there is a jmp to <2>, a new BB starts there.  Also, phi
> instructions are at the start of the BB.  I.e., it should look as
> follows:


Yes, classically they do. But practically they can be anywhere in the
block as long as the copies (the <3> mov <x>s below) are generated at the
correct point in the tree.


> 
>>B[1] <1> pop           ( a )
>>B[2] <3> phi <1> <4>   ( a|c )
>>B[2] <2> pop           ( a|c b )
>>B[2] <4> +   <2> <3>   ( c )
>>B[2]     jmp <3>
> 
> After phi removal, this is:
> 
>>B[1] <1> pop           ( a )
>>B[1] <3> mov <1>
>>B[2] <2> pop           ( a|c b )
>>B[2] <4> +   <2> <3>   ( c )
>>B[2] <3> mov <4>
>>B[2]     jmp <2>

Thaks, that's a good clarification.

> 
>>A few issues. Now I have a DCG rather than a DAG.
> 
> Yes, if you look at the data flow graph including phi nodes and their
> edges, you can get cycles.
> 
>>The other issue is determining that we need a B[1] jmp <2>; that is, not
>>to the head of the block. Either that or the block is split between <1>
>>and <2>; but again, how do we determine that?
> 
> Every branch target starts a new basic block.  Or maybe I
> misunderstand your problem.

It's how to determine the branch targets; I think I may have worked it
out however.

> 
> - anton

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