diff options
author | Richard Biener <rguenther@suse.de> | 2017-06-26 07:19:37 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-06-26 07:19:37 +0000 |
commit | 25853b33482749fb6a07336ea3790a45cc1752f7 (patch) | |
tree | fb16b8aa818baf168138b04424264d43e2164300 /gcc/cfghooks.c | |
parent | ddc36d5a1def2504956a9b40f31f09c5873e6349 (diff) | |
download | gcc-25853b33482749fb6a07336ea3790a45cc1752f7.zip gcc-25853b33482749fb6a07336ea3790a45cc1752f7.tar.gz gcc-25853b33482749fb6a07336ea3790a45cc1752f7.tar.bz2 |
re PR tree-optimization/80928 (SLP vectorization does not handle induction in outer loop vectorization)
2017-06-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/80928
* cfghooks.c (duplicate_block): Do not copy BB_DUPLICATED flag.
(copy_bbs): Set BB_DUPLICATED flag early.
(execute_on_growing_pred): Do not execute for BB_DUPLICATED
marked blocks.
(execute_on_shrinking_pred): Likewise.
* tree-ssa.c (ssa_redirect_edge): Do not look for PHI args in
BB_DUPLICATED blocks.
* tree-ssa-phionlycoprop.c (eliminate_degenerate_phis_1): Properly
iterate over all PHIs considering removal of *gsi.
From-SVN: r249638
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r-- | gcc/cfghooks.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index 1b3f269..bcda422 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -1087,7 +1087,7 @@ duplicate_block (basic_block bb, edge e, basic_block after) if (after) move_block_after (new_bb, after); - new_bb->flags = bb->flags; + new_bb->flags = (bb->flags & ~BB_DUPLICATED); FOR_EACH_EDGE (s, ei, bb->succs) { /* Since we are creating edges from a new block to successors @@ -1207,7 +1207,8 @@ flow_call_edges_add (sbitmap blocks) void execute_on_growing_pred (edge e) { - if (cfg_hooks->execute_on_growing_pred) + if (! (e->dest->flags & BB_DUPLICATED) + && cfg_hooks->execute_on_growing_pred) cfg_hooks->execute_on_growing_pred (e); } @@ -1217,7 +1218,8 @@ execute_on_growing_pred (edge e) void execute_on_shrinking_pred (edge e) { - if (cfg_hooks->execute_on_shrinking_pred) + if (! (e->dest->flags & BB_DUPLICATED) + && cfg_hooks->execute_on_shrinking_pred) cfg_hooks->execute_on_shrinking_pred (e); } @@ -1353,6 +1355,12 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, basic_block bb, new_bb, dom_bb; edge e; + /* Mark the blocks to be copied. This is used by edge creation hooks + to decide whether to reallocate PHI nodes capacity to avoid reallocating + PHIs in the set of source BBs. */ + for (i = 0; i < n; i++) + bbs[i]->flags |= BB_DUPLICATED; + /* Duplicate bbs, update dominators, assign bbs to loops. */ for (i = 0; i < n; i++) { @@ -1360,7 +1368,6 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, bb = bbs[i]; new_bb = new_bbs[i] = duplicate_block (bb, NULL, after); after = new_bb; - bb->flags |= BB_DUPLICATED; if (bb->loop_father) { /* Possibly set loop header. */ |