This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question re: SSA Aggressive Dead Code Elimination
- To: Diego Novillo <dnovillo at redhat dot com>
- Subject: Re: Question re: SSA Aggressive Dead Code Elimination
- From: Daniel Berlin <dan at www dot cgsoftware dot com>
- Date: Wed, 27 Jun 2001 14:09:28 -0400 (EDT)
- cc: <law at redhat dot com>, <gcc at gcc dot gnu dot org>
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.
>