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]
Other format: [Raw text]

Re: mark_operand_necessary in tree-ssa-dce.c


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


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