basic-block.h (struct rtl_bb_info, [...]): Move in front of basic_block_def.

* basic-block.h (struct rtl_bb_info, struct gimple_bb_info): Move
	in front of basic_block_def.
	(struct basic_block_def): Make il.gimple the full struct, not a
	pointer.
	(__assert_gimple_bb_smaller_rtl_bb): Asserting typedef.

	* cfgexpand.c (expand_gimple_basic_block): Clear all il.gimple
	members.
	* gimple-iterator.c (gimple_stmt_iterator): Don't special case
	NULL il.gimple, which can't happen anymore.
	* gimple.h (bb_seq): il.gimple can't be NULL.
	(bb_seq_add): Ditto.
	(set_bb_seq): Adjust.
	(gsi_start_bb, gsi_last_bb): Tidy.
	* lto-streamer-in.c (make_new_block): Don't zero members that
	are zeroed already, don't allocate a gimple_bb_info.
	* tree-cfg.c (create_bb): Don't allocate a gimple_bb_info.
	(remove_bb): Clear all il.gimple members.
	(gimple_verify_flow_info): Adjust for flat il.gimple.
	* tree-flow-inline.h (phi_nodes, phi_nodes_ptr, set_phi_nodes): Adjust.

	* coretypes.h (const_gimple_seq): Remove typedef.
	* gimple.h (gimple_seq_first): Take gimple_seq.
	(gimple_seq_first_stmt): Ditto.
	(gimple_seq_last): Ditto.
	(gimple_seq_last_stmt): Ditto.
	(gimple_seq_empty_p): Ditto.

From-SVN: r187099
This commit is contained in:
Michael Matz 2012-05-03 14:34:07 +00:00 committed by Michael Matz
parent 1fa2969ff6
commit 3e8b732e26
9 changed files with 84 additions and 80 deletions

View File

@ -1,3 +1,33 @@
2012-05-03 Michael Matz <matz@suse.de>
* basic-block.h (struct rtl_bb_info, struct gimple_bb_info): Move
in front of basic_block_def.
(struct basic_block_def): Make il.gimple the full struct, not a
pointer.
(__assert_gimple_bb_smaller_rtl_bb): Asserting typedef.
* cfgexpand.c (expand_gimple_basic_block): Clear all il.gimple
members.
* gimple-iterator.c (gimple_stmt_iterator): Don't special case
NULL il.gimple, which can't happen anymore.
* gimple.h (bb_seq): il.gimple can't be NULL.
(bb_seq_add): Ditto.
(set_bb_seq): Adjust.
(gsi_start_bb, gsi_last_bb): Tidy.
* lto-streamer-in.c (make_new_block): Don't zero members that
are zeroed already, don't allocate a gimple_bb_info.
* tree-cfg.c (create_bb): Don't allocate a gimple_bb_info.
(remove_bb): Clear all il.gimple members.
(gimple_verify_flow_info): Adjust for flat il.gimple.
* tree-flow-inline.h (phi_nodes, phi_nodes_ptr, set_phi_nodes): Adjust.
* coretypes.h (const_gimple_seq): Remove typedef.
* gimple.h (gimple_seq_first): Take gimple_seq.
(gimple_seq_first_stmt): Ditto.
(gimple_seq_last): Ditto.
(gimple_seq_last_stmt): Ditto.
(gimple_seq_empty_p): Ditto.
2012-05-03 Richard Guenther <rguenther@suse.de>
* tree-ssa-pre.c (valid_in_sets): Remove checking of trapping

View File

@ -101,8 +101,27 @@ extern const struct gcov_ctr_summary *profile_info;
/* Declared in cfgloop.h. */
struct loop;
/* Declared in tree-flow.h. */
struct rtl_bb_info;
struct GTY(()) rtl_bb_info {
/* The first and last insns of the block. */
rtx head_;
rtx end_;
/* In CFGlayout mode points to insn notes/jumptables to be placed just before
and after the block. */
rtx header;
rtx footer;
/* This field is used by the bb-reorder pass. */
int visited;
};
struct GTY(()) gimple_bb_info {
/* Sequence of statements in this block. */
gimple_seq seq;
/* PHI nodes for this block. */
gimple_seq phi_nodes;
};
/* A basic block is a sequence of instructions with only entry and
only one exit. If any one of the instructions are executed, they
@ -149,7 +168,7 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d
struct basic_block_def *next_bb;
union basic_block_il_dependent {
struct gimple_bb_info * GTY ((tag ("0"))) gimple;
struct gimple_bb_info GTY ((tag ("0"))) gimple;
struct rtl_bb_info * GTY ((tag ("1"))) rtl;
} GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
@ -172,27 +191,12 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d
int flags;
};
struct GTY(()) rtl_bb_info {
/* The first and last insns of the block. */
rtx head_;
rtx end_;
/* In CFGlayout mode points to insn notes/jumptables to be placed just before
and after the block. */
rtx header;
rtx footer;
/* This field is used by the bb-reorder and tracer passes. */
int visited;
};
struct GTY(()) gimple_bb_info {
/* Sequence of statements in this block. */
gimple_seq seq;
/* PHI nodes for this block. */
gimple_seq phi_nodes;
};
/* This ensures that struct gimple_bb_info is smaller than
struct rtl_bb_info, so that inlining the former into basic_block_def
is the better choice. */
typedef int __assert_gimple_bb_smaller_rtl_bb
[(int)sizeof(struct rtl_bb_info)
- (int)sizeof (struct gimple_bb_info)];
DEF_VEC_P(basic_block);
DEF_VEC_ALLOC_P(basic_block,gc);

View File

@ -3730,7 +3730,8 @@ expand_gimple_basic_block (basic_block bb)
block to be in GIMPLE, instead of RTL. Therefore, we need to
access the BB sequence directly. */
stmts = bb_seq (bb);
bb->il.gimple = NULL;
bb->il.gimple.seq = NULL;
bb->il.gimple.phi_nodes = NULL;
rtl_profile_for_bb (bb);
init_rtl_bb_info (bb);
bb->flags |= BB_RTL;

View File

@ -73,7 +73,6 @@ struct cl_option_handlers;
struct diagnostic_context;
typedef struct diagnostic_context diagnostic_context;
typedef gimple gimple_seq;
typedef gimple const_gimple_seq;
/* Address space number for named address space support. */
typedef unsigned char addr_space_t;

View File

@ -865,6 +865,5 @@ gimple_stmt_iterator
gsi_start_phis (basic_block bb)
{
gimple_seq *pseq = phi_nodes_ptr (bb);
/* XXX check only necessary because ENTRY/EXIT blocks don't have il.gimple */
return pseq ? gsi_start_1 (pseq) : gsi_none ();
return gsi_start_1 (pseq);
}

View File

@ -1023,7 +1023,7 @@ extern bool types_compatible_p (tree, tree);
/* Return the first node in GIMPLE sequence S. */
static inline gimple_seq_node
gimple_seq_first (const_gimple_seq s)
gimple_seq_first (gimple_seq s)
{
return s;
}
@ -1032,7 +1032,7 @@ gimple_seq_first (const_gimple_seq s)
/* Return the first statement in GIMPLE sequence S. */
static inline gimple
gimple_seq_first_stmt (const_gimple_seq s)
gimple_seq_first_stmt (gimple_seq s)
{
gimple_seq_node n = gimple_seq_first (s);
return n;
@ -1042,7 +1042,7 @@ gimple_seq_first_stmt (const_gimple_seq s)
/* Return the last node in GIMPLE sequence S. */
static inline gimple_seq_node
gimple_seq_last (const_gimple_seq s)
gimple_seq_last (gimple_seq s)
{
return s ? s->gsbase.prev : NULL;
}
@ -1051,7 +1051,7 @@ gimple_seq_last (const_gimple_seq s)
/* Return the last statement in GIMPLE sequence S. */
static inline gimple
gimple_seq_last_stmt (const_gimple_seq s)
gimple_seq_last_stmt (gimple_seq s)
{
gimple_seq_node n = gimple_seq_last (s);
return n;
@ -1079,7 +1079,7 @@ gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
/* Return true if GIMPLE sequence S is empty. */
static inline bool
gimple_seq_empty_p (const_gimple_seq s)
gimple_seq_empty_p (gimple_seq s)
{
return s == NULL;
}
@ -1110,13 +1110,13 @@ gimple_seq_alloc_with_stmt (gimple stmt)
static inline gimple_seq
bb_seq (const_basic_block bb)
{
return (!(bb->flags & BB_RTL) && bb->il.gimple) ? bb->il.gimple->seq : NULL;
return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
}
static inline gimple_seq *
bb_seq_addr (const_basic_block bb)
bb_seq_addr (basic_block bb)
{
return (!(bb->flags & BB_RTL) && bb->il.gimple) ? &bb->il.gimple->seq : NULL;
return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
}
/* Sets the sequence of statements in BB to SEQ. */
@ -1125,7 +1125,7 @@ static inline void
set_bb_seq (basic_block bb, gimple_seq seq)
{
gcc_checking_assert (!(bb->flags & BB_RTL));
bb->il.gimple->seq = seq;
bb->il.gimple.seq = seq;
}
@ -4975,20 +4975,9 @@ gsi_start_bb (basic_block bb)
gimple_seq *seq;
seq = bb_seq_addr (bb);
if (!seq)
/* XXX Only necessary because of ENTRY/EXIT block which don't have
il.gimple */
{
i.ptr = NULL;
i.seq = NULL;
i.bb = NULL;
}
else
{
i.ptr = gimple_seq_first (*seq);
i.seq = seq;
i.bb = bb;
}
return i;
}
@ -5019,20 +5008,9 @@ gsi_last_bb (basic_block bb)
gimple_seq *seq;
seq = bb_seq_addr (bb);
if (!seq)
/* XXX Only necessary because of ENTRY/EXIT block which don't have
il.gimple */
{
i.ptr = NULL;
i.seq = NULL;
i.bb = NULL;
}
else
{
i.ptr = gimple_seq_last (*seq);
i.seq = seq;
i.bb = bb;
}
return i;
}

View File

@ -599,10 +599,7 @@ make_new_block (struct function *fn, unsigned int index)
basic_block bb = alloc_block ();
bb->index = index;
SET_BASIC_BLOCK_FOR_FUNCTION (fn, index, bb);
bb->il.gimple = ggc_alloc_cleared_gimple_bb_info ();
n_basic_blocks_for_function (fn)++;
bb->flags = 0;
set_bb_seq (bb, NULL);
return bb;
}

View File

@ -438,7 +438,6 @@ create_bb (void *h, void *e, basic_block after)
bb->index = last_basic_block;
bb->flags = BB_NEW;
bb->il.gimple = ggc_alloc_cleared_gimple_bb_info ();
set_bb_seq (bb, h ? (gimple_seq) h : NULL);
/* Add the new block to the linked list of blocks. */
@ -1918,7 +1917,8 @@ remove_bb (basic_block bb)
}
remove_phi_nodes_and_edges_for_unreachable_block (bb);
bb->il.gimple = NULL;
bb->il.gimple.seq = NULL;
bb->il.gimple.phi_nodes = NULL;
}
@ -4614,13 +4614,13 @@ gimple_verify_flow_info (void)
edge e;
edge_iterator ei;
if (ENTRY_BLOCK_PTR->il.gimple)
if (ENTRY_BLOCK_PTR->il.gimple.seq || ENTRY_BLOCK_PTR->il.gimple.phi_nodes)
{
error ("ENTRY_BLOCK has IL associated with it");
err = 1;
}
if (EXIT_BLOCK_PTR->il.gimple)
if (EXIT_BLOCK_PTR->il.gimple.seq || EXIT_BLOCK_PTR->il.gimple.phi_nodes)
{
error ("EXIT_BLOCK has IL associated with it");
err = 1;

View File

@ -506,18 +506,14 @@ static inline gimple_seq
phi_nodes (const_basic_block bb)
{
gcc_checking_assert (!(bb->flags & BB_RTL));
if (!bb->il.gimple)
return NULL;
return bb->il.gimple->phi_nodes;
return bb->il.gimple.phi_nodes;
}
static inline gimple_seq *
phi_nodes_ptr (const_basic_block bb)
phi_nodes_ptr (basic_block bb)
{
gcc_checking_assert (!(bb->flags & BB_RTL));
if (!bb->il.gimple)
return NULL;
return &bb->il.gimple->phi_nodes;
return &bb->il.gimple.phi_nodes;
}
/* Set PHI nodes of a basic block BB to SEQ. */
@ -528,7 +524,7 @@ set_phi_nodes (basic_block bb, gimple_seq seq)
gimple_stmt_iterator i;
gcc_checking_assert (!(bb->flags & BB_RTL));
bb->il.gimple->phi_nodes = seq;
bb->il.gimple.phi_nodes = seq;
if (seq)
for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
gimple_set_bb (gsi_stmt (i), bb);