From 95cb86978721e08640cdad52fa5c54409ad6488c Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 15 Jan 2014 08:47:30 +0000 Subject: re PR rtl-optimization/59802 (excessive compile time in RTL optimizers (loop unswitching, CPROP)) 2014-01-15 Richard Biener PR rtl-optimization/59802 * lcm.c (compute_available): Use inverted postorder to seed the initial worklist. From-SVN: r206624 --- gcc/lcm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc/lcm.c') diff --git a/gcc/lcm.c b/gcc/lcm.c index aab64a6..70d96c1 100644 --- a/gcc/lcm.c +++ b/gcc/lcm.c @@ -496,12 +496,20 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout, bitmap_vector_ones (avout, last_basic_block_for_fn (cfun)); /* Put every block on the worklist; this is necessary because of the - optimistic initialization of AVOUT above. */ - FOR_EACH_BB_FN (bb, cfun) + optimistic initialization of AVOUT above. Use inverted postorder + to make the dataflow problem require less iterations. */ + int *postorder = XNEWVEC (int, n_basic_blocks_for_fn (cfun)); + int postorder_num = inverted_post_order_compute (postorder); + for (int i = 0; i < postorder_num; ++i) { + bb = BASIC_BLOCK_FOR_FN (cfun, postorder[i]); + if (bb == EXIT_BLOCK_PTR_FOR_FN (cfun) + || bb == ENTRY_BLOCK_PTR_FOR_FN (cfun)) + continue; *qin++ = bb; bb->aux = bb; } + free (postorder); qin = worklist; qend = &worklist[n_basic_blocks_for_fn (cfun) - NUM_FIXED_BLOCKS]; -- cgit v1.1