use *_grow_cleared rather than *_grow on vec<bitmap_head>
commita561369743025fd64a3d87bc571d0503b17a82c8
authorJakub Jelinek <jakub@redhat.com>
Fri, 29 Sep 2023 07:35:01 +0000 (29 09:35 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 29 Sep 2023 07:35:01 +0000 (29 09:35 +0200)
tree6fa616adce64711e201e4b5be34904c27df2202b
parent14c363c13560fe7333fa487bff7dddcc07c5640b
use *_grow_cleared rather than *_grow on vec<bitmap_head>

The assert checking which is commented out in vec.h grow method requires
trivially default constructible types to be used with this method, but
bitmap_head has since the PR88317 r9-4642 workaround non-trivial default
constructor to catch bugs and we pay the minimum price of initializing
everything in bitmap_head twice on the common
  bitmap_head var;
  bitmap_initilize (&var, obstack);
sequence.  This patch makes us pay the same price times number of elements
on
  vec<bitmap_head> v;
  v.create (n);
  v.safe_grow_cleared (n); // previous v.safe_grow (n);
  for (int i = 0; i < n; ++i)
    bitmap_initialize (&v[i], obstack);

2023-09-29  Jakub Jelinek  <jakub@redhat.com>

* tree-ssa-loop-im.cc (tree_ssa_lim_initialize): Use quick_grow_cleared
instead of quick_grow on vec<bitmap_head> members.
* cfganal.cc (control_dependences::control_dependences): Likewise.
* rtl-ssa/blocks.cc (function_info::build_info::build_info): Likewise.
(function_info::place_phis): Use safe_grow_cleared instead of safe_grow
on auto_vec<bitmap_head> vars.
* tree-ssa-live.cc (compute_live_vars): Use quick_grow_cleared instead
of quick_grow on vec<bitmap_head> var.
gcc/cfganal.cc
gcc/rtl-ssa/blocks.cc
gcc/tree-ssa-live.cc
gcc/tree-ssa-loop-im.cc