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]

mark_operand_necessary in tree-ssa-dce.c


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.






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