pro64-support
[Top] [All Lists]

Re: Hyperblock bug?

To: Richard Shapiro <rshapiro@xxxxxxxxxxxx>
Subject: Re: Hyperblock bug?
From: Matthew McNaughton <mcnaught@xxxxxxxxxxxxxx>
Date: Thu, 19 Apr 2001 18:09:34 -0600 (MDT)
Cc: pro64-support@xxxxxxxxxxx
In-reply-to: <200104191550.LAA10319@localhost.localdomain>
Sender: owner-pro64-support@xxxxxxxxxxx
On Thu, 19 Apr 2001, Richard Shapiro wrote:

>    At be/cg/hb_id_candidates.cxx, ~line 627 (version 0.12):
> 
>        if (!BB_SET_MemberP(BB_dom_set(pdom), dom)) {
>          for (dom = Find_Immediate_Dominator(dom);
>               dom && !BB_SET_MemberP(BB_dom_set(pdom), dom);
>               dom = Find_Immediate_Dominator(pdom));
>        }
> 
>    I think the last call to Find_Immediate_Dominator(pdom) should be
>    Find_Immediate_Dominator(dom).
> 
> Refresh my memory. Why do you think this? Could you send out a larger chunk
> of the code (since I don;t have an active development set right now).

I put a copy at
http://www.cs.ualberta.ca/~mcnaught/c680/hb_id_candidates.cxx

This is in the function Check_Region()

The point of this snip of code is that we start with a tentative entry
("dom") to a hammock region, and a tentative exit ("pdom") for the same
hammock region, and we are looking upwards in the dominance hierarchy from
dom until we find a block that dominates pdom. But in this loop, we may
jump downwards in the hierarchy to just above pdom, which undoes a whole
bunch of work. It doesn't end up making an illegal candidate region, but
it may fail to find the desired one.

If you look just below this point you'll see a loop that parallels this
one, looking for a post-dominator of our tentative entry point.


      if (dom && !BB_SET_MemberP(BB_pdom_set(dom), pdom)) {
        for (pdom = Find_Immediate_Postdominator(pdom);
             pdom && !BB_SET_MemberP(BB_pdom_set(dom), pdom);
             pdom = Find_Immediate_Postdominator(pdom));
      }

I hope this makes it clear. I also found some other minor bugs I'll write
up later.

-- 
Matthew McNaughton <mcnaught@xxxxxxxxxxxxxx>


<Prev in Thread] Current Thread [Next in Thread>