Commit b29fcf3b by Kugan Vivekanandarajah Committed by Kugan Vivekanandarajah

tree-vrp.c (set_value_range): Use vrp_equiv_obstack with BITMAP_ALLOC.

gcc/ChangeLog:

2016-08-04  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* tree-vrp.c (set_value_range): Use vrp_equiv_obstack with
	BITMAP_ALLOC.
	(add_equivalence): Likewise.
	(get_value_range): Allocate value range with vrp_value_range_pool.
	(vrp_initialize): Initialize vrp_equiv_obstack for equiv allocation.
	(vrp_finalize): Relase vrp_equiv_obstack and vrp_value_range_pool.

From-SVN: r239113
parent 5c5ad8cd
2016-08-04 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-vrp.c (set_value_range): Use vrp_equiv_obstack with
BITMAP_ALLOC.
(add_equivalence): Likewise.
(get_value_range): Allocate value range with vrp_value_range_pool.
(vrp_initialize): Initialize vrp_equiv_obstack for equiv allocation.
(vrp_finalize): Relase vrp_equiv_obstack and vrp_value_range_pool.
2016-08-03 Peter Bergner <bergner@vnet.ibm.com> 2016-08-03 Peter Bergner <bergner@vnet.ibm.com>
* config/rs6000/rs6000.c (rs6000_option_override_internal): Make LRA * config/rs6000/rs6000.c (rs6000_option_override_internal): Make LRA
......
...@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h" #include "target.h"
#include "case-cfn-macros.h" #include "case-cfn-macros.h"
#include "params.h" #include "params.h"
#include "alloc-pool.h"
/* Range of values that can be associated with an SSA_NAME after VRP /* Range of values that can be associated with an SSA_NAME after VRP
has executed. */ has executed. */
...@@ -88,6 +89,10 @@ struct value_range ...@@ -88,6 +89,10 @@ struct value_range
#define VR_INITIALIZER { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL } #define VR_INITIALIZER { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL }
/* Allocation pools for tree-vrp allocations. */
static object_allocator<value_range> vrp_value_range_pool ("Tree VRP value ranges");
static bitmap_obstack vrp_equiv_obstack;
/* Set of SSA names found live during the RPO traversal of the function /* Set of SSA names found live during the RPO traversal of the function
for still active basic-blocks. */ for still active basic-blocks. */
static sbitmap *live; static sbitmap *live;
...@@ -407,7 +412,7 @@ set_value_range (value_range *vr, enum value_range_type t, tree min, ...@@ -407,7 +412,7 @@ set_value_range (value_range *vr, enum value_range_type t, tree min,
bitmaps, only do it if absolutely necessary. */ bitmaps, only do it if absolutely necessary. */
if (vr->equiv == NULL if (vr->equiv == NULL
&& equiv != NULL) && equiv != NULL)
vr->equiv = BITMAP_ALLOC (NULL); vr->equiv = BITMAP_ALLOC (&vrp_equiv_obstack);
if (equiv != vr->equiv) if (equiv != vr->equiv)
{ {
...@@ -689,7 +694,8 @@ get_value_range (const_tree var) ...@@ -689,7 +694,8 @@ get_value_range (const_tree var)
return CONST_CAST (value_range *, &vr_const_varying); return CONST_CAST (value_range *, &vr_const_varying);
/* Create a default value range. */ /* Create a default value range. */
vr_value[ver] = vr = XCNEW (value_range); vr_value[ver] = vr = vrp_value_range_pool.allocate ();
memset (vr, 0, sizeof (*vr));
/* Defer allocating the equivalence set. */ /* Defer allocating the equivalence set. */
vr->equiv = NULL; vr->equiv = NULL;
...@@ -818,7 +824,7 @@ add_equivalence (bitmap *equiv, const_tree var) ...@@ -818,7 +824,7 @@ add_equivalence (bitmap *equiv, const_tree var)
value_range *vr = vr_value[ver]; value_range *vr = vr_value[ver];
if (*equiv == NULL) if (*equiv == NULL)
*equiv = BITMAP_ALLOC (NULL); *equiv = BITMAP_ALLOC (&vrp_equiv_obstack);
bitmap_set_bit (*equiv, ver); bitmap_set_bit (*equiv, ver);
if (vr && vr->equiv) if (vr && vr->equiv)
bitmap_ior_into (*equiv, vr->equiv); bitmap_ior_into (*equiv, vr->equiv);
...@@ -6967,6 +6973,7 @@ vrp_initialize (void) ...@@ -6967,6 +6973,7 @@ vrp_initialize (void)
num_vr_values = num_ssa_names; num_vr_values = num_ssa_names;
vr_value = XCNEWVEC (value_range *, num_vr_values); vr_value = XCNEWVEC (value_range *, num_vr_values);
vr_phi_edge_counts = XCNEWVEC (int, num_ssa_names); vr_phi_edge_counts = XCNEWVEC (int, num_ssa_names);
bitmap_obstack_initialize (&vrp_equiv_obstack);
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
...@@ -10291,15 +10298,10 @@ vrp_finalize (bool warn_array_bounds_p) ...@@ -10291,15 +10298,10 @@ vrp_finalize (bool warn_array_bounds_p)
identify_jump_threads (); identify_jump_threads ();
/* Free allocated memory. */ /* Free allocated memory. */
for (i = 0; i < num_vr_values; i++)
if (vr_value[i])
{
BITMAP_FREE (vr_value[i]->equiv);
free (vr_value[i]);
}
free (vr_value); free (vr_value);
free (vr_phi_edge_counts); free (vr_phi_edge_counts);
bitmap_obstack_release (&vrp_equiv_obstack);
vrp_value_range_pool.release ();
/* So that we can distinguish between VRP data being available /* So that we can distinguish between VRP data being available
and not available. */ and not available. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment