This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Use bb->flags instead of bb->aux for flags in cfgcleanup.c
- From: Roger Sayle <roger at eyesopen dot com>
- To: Steven Bosscher <stevenb at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 26 Jun 2005 17:01:37 -0600 (MDT)
- Subject: Re: [patch] Use bb->flags instead of bb->aux for flags in cfgcleanup.c
On Mon, 27 Jun 2005, Steven Bosscher wrote:
>
> * basic-block.h: Give the BB flags enum a name, bb_flags.
> Add new flags BB_FORWARDER_BLOCK, and BB_NONTHREADABLE_BLOCK.
> * cfgcleanup.c (enum bb_flags): Remove here.
> (BB_FLAGS, BB_SET_FLAG, BB_CLEAR_FLAG, FORWARDER_BLOCK_P): Remove.
> (notice_new_block): Set/test bb->flags instead of aux via BB_FLAGS.
> (update_forwarder_flag): Likewise.
> (try_simplify_condjump): Likewise.
> (thread_jump): Likewise.
> (try_forward_edges): Likewise.
> (merge_blocks_move): Likewise.
> (outgoing_edges_match): Likewise.
> (try_crossjump_to_edge): Likewise.
> (try_optimize_cfg): Likewise. Clear bb->flags before updating the
> forwarder flags. Don't clear bb->aux for all basic blocks. Only
> reset the BB_FORWARDER_BLOCK and BB_NONTHREADABLE_BLOCK flags.
I like the concept of this patch, but it can be made less intrusive
by continuing to keep the FORWARDER_BLOCK_P macro, but instead defining
it to use the basic block's flags and the new enumerated value. i.e.
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
Although the same could also be done for BB_FLAGS (whose only other use
could be turned into a NONTHREADABLE_BLOCK_P), and even BB_SET_FLAG and
BB_CLEAR_FLAG, I think with the exception of FORWARDER_BLOCK_P your
proposed changes are just as readable as the original.
This patch is OK for mainline with the above change of keeping the
FORWARDER_BLOCK_P macro.
Thanks in advance,
Roger
--