mark_operand_necessary in tree-ssa-dce.c

Daniel Berlin dberlin@dberlin.org
Wed Jan 26 21:58:00 GMT 2005


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.

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.

2. Conversely, the only time the processed bit is false is when necessary 
hasn't been set yet, so this is a statement we need to process and put on 
the worklist, which we'll do.

3. Thus, the processed sbitmap should exactly match the state of 
necessary, or lag slightly behind it

It can lag slightly behind if processed was not set but 
necessary was, which can happen because not all sets of necessary/adds 
to the worklist go through mark_operand_necessary in the initial 
seeding.  But this doesn't make it useful, it makes is even less useful, 
because we are still going to see that necessary was set and return

4. Therefore, i believe the processed sbitmap is just useless bit 
diddling.

Anyone disagree?
If not, i'll bootstrap and regtest a patch to remove it.







More information about the Gcc mailing list