aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-11-22 09:05:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-11-22 09:05:53 +0000
commit608c0f631803f888363bccff43a57027538ff03e (patch)
tree28545debd89aa0dd6f1953fb4d48e97f80f783d6 /gcc
parent9cf7bfd919f394595c0ac561ed67b333a39ae51e (diff)
downloadgcc-608c0f631803f888363bccff43a57027538ff03e.zip
gcc-608c0f631803f888363bccff43a57027538ff03e.tar.gz
gcc-608c0f631803f888363bccff43a57027538ff03e.tar.bz2
gimple-iterator.c (gimple_find_edge_insert_loc): Ignore fake edges to exit when looking for a place to insert.
2017-11-22 Richard Biener <rguenther@suse.de> * gimple-iterator.c (gimple_find_edge_insert_loc): Ignore fake edges to exit when looking for a place to insert. * tree-ssa-pre.c (clear_expression_ids): Inline into callers and remove. (insert_into_preds_of_block): Commit edge insertion immediately, assert that doesn't require new BBs. (fini_pre): Release expressions. (pass_pre::execute): Shuffle things around a bit, if the fn is too large do not compute AVAIL either as this is really the quadratic bit. From-SVN: r255047
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/gimple-iterator.c7
-rw-r--r--gcc/tree-ssa-pre.c33
3 files changed, 31 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fb8de9a..dc96750 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,18 @@
2017-11-22 Richard Biener <rguenther@suse.de>
+ * gimple-iterator.c (gimple_find_edge_insert_loc): Ignore
+ fake edges to exit when looking for a place to insert.
+ * tree-ssa-pre.c (clear_expression_ids): Inline into callers
+ and remove.
+ (insert_into_preds_of_block): Commit edge insertion immediately,
+ assert that doesn't require new BBs.
+ (fini_pre): Release expressions.
+ (pass_pre::execute): Shuffle things around a bit, if the fn
+ is too large do not compute AVAIL either as this is really the
+ quadratic bit.
+
+2017-11-22 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/83089
* tree-if-conv.c (pass_if_conversion::execute): If anything
changed reset SCEV and free the number of iteration estimates.
diff --git a/gcc/gimple-iterator.c b/gcc/gimple-iterator.c
index d9d02d3..9841eb1 100644
--- a/gcc/gimple-iterator.c
+++ b/gcc/gimple-iterator.c
@@ -763,7 +763,12 @@ gimple_find_edge_insert_loc (edge e, gimple_stmt_iterator *gsi,
Except for the entry block. */
src = e->src;
if ((e->flags & EDGE_ABNORMAL) == 0
- && single_succ_p (src)
+ && (single_succ_p (src)
+ /* Do not count a fake edge as successor as added to infinite
+ loops by connect_infinite_loops_to_exit. */
+ || (EDGE_COUNT (src->succs) == 2
+ && (EDGE_SUCC (src, 0)->flags & EDGE_FAKE
+ || EDGE_SUCC (src, 1)->flags & EDGE_FAKE)))
&& src != ENTRY_BLOCK_PTR_FOR_FN (cfun))
{
*gsi = gsi_last_bb (src);
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index ecc3484..477a41e 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -400,15 +400,6 @@ expression_for_id (unsigned int id)
return expressions[id];
}
-/* Free the expression id field in all of our expressions,
- and then destroy the expressions array. */
-
-static void
-clear_expression_ids (void)
-{
- expressions.release ();
-}
-
static object_allocator<pre_expr_d> pre_expr_pool ("pre_expr nodes");
/* Given an SSA_NAME NAME, get or create a pre_expr to represent it. */
@@ -1331,7 +1322,6 @@ get_representative_for (const pre_expr e)
}
-
static pre_expr
phi_translate (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
basic_block pred, basic_block phiblock);
@@ -3004,7 +2994,8 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
gcc_assert (!(pred->flags & EDGE_ABNORMAL));
if (!gimple_seq_empty_p (stmts))
{
- gsi_insert_seq_on_edge (pred, stmts);
+ basic_block new_bb = gsi_insert_seq_on_edge_immediate (pred, stmts);
+ gcc_assert (! new_bb);
insertions = true;
}
if (!builtexpr)
@@ -4127,6 +4118,7 @@ static void
fini_pre ()
{
value_expressions.release ();
+ expressions.release ();
BITMAP_FREE (inserted_exprs);
bitmap_obstack_release (&grand_bitmap_obstack);
bitmap_set_pool.release ();
@@ -4181,22 +4173,21 @@ pass_pre::execute (function *fun)
loop_optimizer_init may create new phis, etc. */
loop_optimizer_init (LOOPS_NORMAL);
split_critical_edges ();
+ scev_initialize ();
run_scc_vn (VN_WALK);
init_pre ();
- scev_initialize ();
-
- /* Collect and value number expressions computed in each basic block. */
- compute_avail ();
/* Insert can get quite slow on an incredibly large number of basic
blocks due to some quadratic behavior. Until this behavior is
fixed, don't run it when he have an incredibly large number of
bb's. If we aren't going to run insert, there is no point in
- computing ANTIC, either, even though it's plenty fast. */
+ computing ANTIC, either, even though it's plenty fast nor do
+ we require AVAIL. */
if (n_basic_blocks_for_fn (fun) < 4000)
{
+ compute_avail ();
compute_antic ();
insert ();
}
@@ -4211,19 +4202,19 @@ pass_pre::execute (function *fun)
not keeping virtual operands up-to-date. */
gcc_assert (!need_ssa_update_p (fun));
- /* Remove all the redundant expressions. */
- todo |= vn_eliminate (inserted_exprs);
-
statistics_counter_event (fun, "Insertions", pre_stats.insertions);
statistics_counter_event (fun, "PA inserted", pre_stats.pa_insert);
statistics_counter_event (fun, "HOIST inserted", pre_stats.hoist_insert);
statistics_counter_event (fun, "New PHIs", pre_stats.phis);
- clear_expression_ids ();
+ /* Remove all the redundant expressions. */
+ todo |= vn_eliminate (inserted_exprs);
- scev_finalize ();
remove_dead_inserted_code ();
+
fini_pre ();
+
+ scev_finalize ();
loop_optimizer_finalize ();
/* Restore SSA info before tail-merging as that resets it as well. */