This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mark_operand_necessary in tree-ssa-dce.c
- From: Jeffrey A Law <law at redhat dot com>
- To: dberlin at dberlin dot org
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Jan 2005 13:14:07 -0700
- Subject: Re: mark_operand_necessary in tree-ssa-dce.c
- Organization: Red Hat, Inc
- Reply-to: law at redhat dot com
On Wed, 2005-01-26 at 15:08 -0500, Daniel Berlin wrote:
> Can someone (ben, i think you wrote this code) please explain to me
why we
> require a processed sbitmap in this function?
>
> ISTM that if we are here, we are going to always mark the statement
as
> necessary. And if it was already marked as necessary, we return before
we
> put it on the worklist again anyway.
I'm not sure your logic is correct.
>
> My thinking goes like this:
>
> 1 If the processed bit is true, we would have returned 3 lines
> later anyway, because the only time the processed bit can be already
true
> is when necessary is true.
Not true. Consider the case where PHIONLY is true and STMT is not a phi
node. We would have marked the SSA_NAME as necessary, but the
underlying statement may not be marked as necesssary. If we ever call
mark_operand_necessary with the same SSA_NAME again we will return
without ever setting NECESSARY for the PHI node.
If we dropped PROCESSED bitmap, then we would mark the PHI node as
necessary in that case. Which I believe would keep PHIs around that
are unnecessary (see the comment before
mark_really_necessary_kill_operand_phis
Jeff