Commit 01273677 by Steven Bosscher

re PR middle-end/54146 (Very slow compile with attribute((flatten)))

	PR middle-end/54146
	* tree-flow.h (compute_global_livein): Remove prototype.
	* tree-into-ssa.c (compute_global_livein): Remove function.
	* tree-ssa-loop-manip.c: Include gimple-pretty-print.h.
	(find_sibling_superloop): New function.
	(compute_live_loop_exits): New function.
	(add_exit_phis_edge): Rename to add_exit_phi.  Do not allow
	inserting a PHI in a block that is not a loop exit for VAR.
	Add dumping if TDF_DETAILS.
	(add_exit_phis_var): Rewrite.
	(add_exit_phis): Update.
	(get_loops_exits): Rewrite to return an array of per-loop exits
	rather than one bitmap with all loop exits.
	(find_uses_to_rename_bb): Ignore virtual PHI nodes.
	(rewrite_into_loop_closed_ssa): Update.

From-SVN: r190442
parent ca9b1cd8
2012-08-16 Steven Bosscher <steven@gcc.gnu.org>
PR middle-end/54146
* tree-flow.h (compute_global_livein): Remove prototype.
* tree-into-ssa.c (compute_global_livein): Remove function.
* tree-ssa-loop-manip.c: Include gimple-pretty-print.h.
(find_sibling_superloop): New function.
(compute_live_loop_exits): New function.
(add_exit_phis_edge): Rename to add_exit_phi. Do not allow
inserting a PHI in a block that is not a loop exit for VAR.
Add dumping if TDF_DETAILS.
(add_exit_phis_var): Rewrite.
(add_exit_phis): Update.
(get_loops_exits): Rewrite to return an array of per-loop exits
rather than one bitmap with all loop exits.
(find_uses_to_rename_bb): Ignore virtual PHI nodes.
(rewrite_into_loop_closed_ssa): Update.
2012-08-16 Nick Clifton <nickc@redhat.com>
* config/i386/i386elf.h (ASM_OUTPUT_ASCII): Cast _ascii_bytes
......
......@@ -521,7 +521,6 @@ tree create_new_def_for (tree, gimple, def_operand_p);
bool need_ssa_update_p (struct function *);
bool name_registered_for_update_p (tree);
void release_ssa_name_after_update_ssa (tree);
void compute_global_livein (bitmap, bitmap);
void mark_virtual_operands_for_renaming (struct function *);
tree get_current_def (tree);
void set_current_def (tree, tree);
......
......@@ -404,63 +404,6 @@ set_current_def (tree var, tree def)
get_common_info (var)->current_def = def;
}
/* Compute global livein information given the set of blocks where
an object is locally live at the start of the block (LIVEIN)
and the set of blocks where the object is defined (DEF_BLOCKS).
Note: This routine augments the existing local livein information
to include global livein (i.e., it modifies the underlying bitmap
for LIVEIN). */
void
compute_global_livein (bitmap livein, bitmap def_blocks)
{
unsigned i;
bitmap_iterator bi;
VEC (basic_block, heap) *worklist;
/* Normally the work list size is bounded by the number of basic
blocks in the largest loop. We don't know this number, but we
can be fairly sure that it will be relatively small. */
worklist = VEC_alloc (basic_block, heap, MAX (8, n_basic_blocks / 128));
EXECUTE_IF_SET_IN_BITMAP (livein, 0, i, bi)
VEC_safe_push (basic_block, heap, worklist, BASIC_BLOCK (i));
/* Iterate until the worklist is empty. */
while (! VEC_empty (basic_block, worklist))
{
edge e;
edge_iterator ei;
/* Pull a block off the worklist. */
basic_block bb = VEC_pop (basic_block, worklist);
/* Make sure we have at least enough room in the work list
for all predecessors of this block. */
VEC_reserve (basic_block, heap, worklist, EDGE_COUNT (bb->preds));
/* For each predecessor block. */
FOR_EACH_EDGE (e, ei, bb->preds)
{
basic_block pred = e->src;
int pred_index = pred->index;
/* None of this is necessary for the entry block. */
if (pred != ENTRY_BLOCK_PTR
&& ! bitmap_bit_p (def_blocks, pred_index)
&& bitmap_set_bit (livein, pred_index))
{
VEC_quick_push (basic_block, worklist, pred);
}
}
}
VEC_free (basic_block, heap, worklist);
}
/* Cleans up the REWRITE_THIS_STMT and REGISTER_DEFS_IN_THIS_STMT flags for
all statements in basic block BB. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment