aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-into-ssa.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-11-21 13:46:18 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-11-21 13:46:18 +0000
commitd78b70959f334699bf556e9b8d4e0a8c12a64b46 (patch)
treebbeb4dbda1117ae17d50415a6053d914cf30f236 /gcc/tree-into-ssa.c
parente2a05fdfd4798192493c582ec6528c975bfa9b0c (diff)
downloadgcc-d78b70959f334699bf556e9b8d4e0a8c12a64b46.zip
gcc-d78b70959f334699bf556e9b8d4e0a8c12a64b46.tar.gz
gcc-d78b70959f334699bf556e9b8d4e0a8c12a64b46.tar.bz2
cfgloop.h (loop_iterator::~loop_iterator): Remove.
2019-11-21 Richard Biener <rguenther@suse.de> * cfgloop.h (loop_iterator::~loop_iterator): Remove. (loop_iterator::to_visit): Use an auto_vec with internal storage. (loop_iterator::loop_iterator): Adjust. * cfganal.c (compute_dominance_frontiers_1): Fold into... (compute_dominance_frontiers): ... this. Hoist invariant get_immediate_dominator call. (compute_idf): Use a work-set instead of a work-list for more optimal iteration order and duplicate avoidance. * tree-into-ssa.c (mark_phi_for_rewrite): Avoid re-allocating the vector all the time, instead pre-allocate the vector only once. (delete_update_ssa): Simplify. * vec.h (va_heap::release): Disable -Wfree-nonheap-object around it. From-SVN: r278550
Diffstat (limited to 'gcc/tree-into-ssa.c')
-rw-r--r--gcc/tree-into-ssa.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index f2a91a1..e2c9377 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -940,14 +940,18 @@ mark_phi_for_rewrite (basic_block bb, gphi *phi)
if (!blocks_with_phis_to_rewrite)
return;
- bitmap_set_bit (blocks_with_phis_to_rewrite, idx);
-
- n = (unsigned) last_basic_block_for_fn (cfun) + 1;
- if (phis_to_rewrite.length () < n)
- phis_to_rewrite.safe_grow_cleared (n);
+ if (bitmap_set_bit (blocks_with_phis_to_rewrite, idx))
+ {
+ n = (unsigned) last_basic_block_for_fn (cfun) + 1;
+ if (phis_to_rewrite.length () < n)
+ phis_to_rewrite.safe_grow_cleared (n);
- phis = phis_to_rewrite[idx];
- phis.reserve (10);
+ phis = phis_to_rewrite[idx];
+ gcc_assert (!phis.exists ());
+ phis.create (10);
+ }
+ else
+ phis = phis_to_rewrite[idx];
phis.safe_push (phi);
phis_to_rewrite[idx] = phis;
@@ -2937,11 +2941,7 @@ delete_update_ssa (void)
if (blocks_with_phis_to_rewrite)
EXECUTE_IF_SET_IN_BITMAP (blocks_with_phis_to_rewrite, 0, i, bi)
- {
- vec<gphi *> phis = phis_to_rewrite[i];
- phis.release ();
- phis_to_rewrite[i].create (0);
- }
+ phis_to_rewrite[i].release ();
BITMAP_FREE (blocks_with_phis_to_rewrite);
BITMAP_FREE (blocks_to_update);