From: Devang Patel <dpatel@apple.com>
To: Dale Johannesen <dalej@apple.com>
Cc: Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>,
"gcc@gcc.gnu.org list" <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa vs lno] who is right?
Date: Fri, 26 Mar 2004 21:09:00 -0000 [thread overview]
Message-ID: <C4CD2900-7F55-11D8-9BD5-000393A91CAA@apple.com> (raw)
In-Reply-To: <99B44A2E-7F52-11D8-8C7F-000A95D7CD40@apple.com>
On Mar 26, 2004, at 10:22 AM, Dale Johannesen wrote:
>
> On Mar 26, 2004, at 10:10 AM, Zdenek Dvorak wrote:
>
>> Hello,
>>
>>> When the LNO branch copies a loop, it attempts to fix up the phi
>>> nodes
>>> with
>>> an algorithm that assumes there is only one phi per block per
>>> variable.
>>> That is, it
>>> won't see code like this:
>>
>> (i.e. what do you mean by "copying a loop")?
>
> tree_duplicate_loop_to_header_edge (called from unswitching in the
> failing case)
I saw this happening couple of days ago at this point in
tree_duplicate_loop...
/* Add phi nodes for definitions to exit_block (we could find out
which of them are really used outside of the loop and don't
emit the
phi nodes for the remaining ones; for this we would however
need
to know immediate uses). */
for (arg = usable_outside; arg; arg = TREE_CHAIN (arg))
{
def = TREE_VALUE (arg);
phi = create_phi_node (def, exit_block);
for (ae = exit_block->pred; ae; ae = ae->pred_next)
add_phi_arg (&phi, def, ae);
}
>> where do we assume this
>
> lv_adjust_loop_header_phi . The assumption is explicit:
>
> /* There can not be second phi node for the same
> variable.
> Get out of the for loop that walks phi nodes
> of 'first'.
> */
Yes, that's what my understanding was (until this thread). I'm glad I
note down my assumptions.
> There isn't any way to find the right phi at that point AFAICT,
That's what I found at that time... here is what I am trying to do
in lv_adjust_loop_header_phi
/* Adjust phi nodes for 'first' basic block. 'second' basic block is a
copy
of 'first'. Both of them are dominated by 'new_head' basic block.
When
'new_head' was created by [splitting] 'second's incoming edge it
received phi arguments
on the edge by split_edge(). Later, additional edge 'e' was created
to
connect 'new_head' and 'first'. Now this routnine adds phi args on
this
additional edge 'e' that new_head to second edge received as part of
edge
splitting.
*/
-
Devang
> so I'm thinking
> along the lines of making sure the phi lists are in the same order
> when doing
> the loop duplication earlier (they aren't now).
>
>> While this certainly is unlikely to happen, there probably is nothing
>> that would prevent it.
>
>> Zdenek
>>
>>> ;; basic block 19, loop depth 0, count 0
>>> ;; prev block 9, next block 20
>>> ;; pred: 10 [100.0%] (fallthru)
>>> ;; succ: 28 [50.0%] (true,exec) 29 [50.0%] (false,exec)
>>> # maxmin_Result_140 = PHI <1(10)>;
>>> # maxmin_Result_142 = PHI <2(10)>;
>>> # lsm_tmp.19_144 = PHI <lsm_tmp.19_84(10)>;
>>> <L28>:;
>>> if (m__10 == 0) goto <L26>; else goto <L27>;
>>>
>>> Is that suppose to be a valid assumption? The dup is created by
>>> copyrename, and
>>> I see no code there that's intended to stop dups from being created
>>> (on
>>> the
>>> contrary, but surely it's unusual for the live ranges to overlap).
>>>
prev parent reply other threads:[~2004-03-26 18:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-26 5:32 Dale Johannesen
2004-03-26 6:34 ` Diego Novillo
2004-03-26 6:35 ` Dale Johannesen
2004-03-26 7:08 ` Diego Novillo
2004-03-26 7:27 ` Andrew Pinski
2004-03-26 16:21 ` Andrew MacLeod
2004-03-26 16:31 ` Diego Novillo
2004-03-26 16:40 ` Andrew MacLeod
2004-03-26 17:48 ` law
2004-03-26 18:08 ` Andrew MacLeod
2004-03-26 18:10 ` law
2004-03-26 18:49 ` Dale Johannesen
2004-03-26 16:44 ` law
2004-03-26 17:42 ` Diego Novillo
2004-03-26 18:51 ` Zdenek Dvorak
2004-03-26 20:15 ` Dale Johannesen
2004-03-26 21:09 ` Devang Patel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C4CD2900-7F55-11D8-9BD5-000393A91CAA@apple.com \
--to=dpatel@apple.com \
--cc=dalej@apple.com \
--cc=gcc@gcc.gnu.org \
--cc=rakdver@atrey.karlin.mff.cuni.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).