This is the mail archive of the
mailing list for the GCC project.
mark_operand_necessary in tree-ssa-dce.c
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Cc: bje at redhat dot com
- Date: Wed, 26 Jan 2005 15:08:07 -0500 (EST)
- Subject: 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
If not, i'll bootstrap and regtest a patch to remove it.