This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Question re: SSA Aggressive Dead Code Elimination




On Wed, 27 Jun 2001, Diego Novillo wrote:

> On Wed, 27 Jun 2001, Daniel Berlin wrote:
>
> > law@redhat.com writes:
> >
> > > I'm not sure which is the better solution.
> >
> > Oh, and BTW, the reason you are running into this problem is that
> > you've changed the dominance frontier (by removing 0 as a dominator of
> > 1) , and thus, changed the IDF, and thus, eliminated the need for a
> >    phi node there.
> > I think, anyway.
> >
> No.  The dominance frontier was never changed.  What changed was
> that the phi term stopped being important because we deleted one
> of its arguments.

No, we didn't delete one of it's arguments, we changed it. It still has
two arguments. In fact, all we did was transform

a=b+c
if (a>d) { b=b+c; }
return b;
into
a=b+c
if (a> d) { b=a; }
return b

This shouldn't change the importance of anything.
b still depends on the if block.
The phi term is still important, the dce pass just doesn't think it is.
The DCE pass should be marking the control transfer  instructions of the
blocks on which the phi node depends as important.


> Nope.  What we ended up having was a trivially dead phi term.

You are making the same mistake I did.
The phi term *isn't* trivially dead. And  because it's not dead, the jump
instruction in the block the phi node has for that term, should be marked
important, so it doesn't become unconditional.


>
> Diego.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]