Commit 1d6e77c5 by Richard Biener Committed by Richard Biener

tree-ssa-sccvn.c (sccvn_dom_walker): Add unreachable_dom member and initialize it.

2015-12-04  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (sccvn_dom_walker): Add unreachable_dom
	member and initialize it.
	(sccvn_dom_walker::after_dom_children): Reset unreachable_dom
	if necessary.
	(sccvn_dom_walker::before_dom_children): If unreachable_dom
	is set BB is not reachable either.  Set unreachable_dom
	if not set and BB is unreachable.

From-SVN: r231262
parent 1a8c6eff
2015-12-04 Richard Biener <rguenther@suse.de>
* tree-ssa-sccvn.c (sccvn_dom_walker): Add unreachable_dom
member and initialize it.
(sccvn_dom_walker::after_dom_children): Reset unreachable_dom
if necessary.
(sccvn_dom_walker::before_dom_children): If unreachable_dom
is set BB is not reachable either. Set unreachable_dom
if not set and BB is unreachable.
2015-12-04 Richard Biener <rguenther@suse.de>
* bitmap.c (bitmap_find_bit): Guard the bitmap descriptor
query with GATHER_STATISTICS.
......@@ -4207,7 +4207,8 @@ class sccvn_dom_walker : public dom_walker
{
public:
sccvn_dom_walker ()
: dom_walker (CDI_DOMINATORS), fail (false), cond_stack (vNULL) {}
: dom_walker (CDI_DOMINATORS), fail (false), unreachable_dom (NULL),
cond_stack (vNULL) {}
~sccvn_dom_walker ();
virtual void before_dom_children (basic_block);
......@@ -4219,6 +4220,7 @@ public:
enum tree_code code, tree lhs, tree rhs, bool value);
bool fail;
basic_block unreachable_dom;
vec<std::pair <basic_block, std::pair <vn_nary_op_t, vn_nary_op_t> > >
cond_stack;
};
......@@ -4299,6 +4301,9 @@ sccvn_dom_walker::record_conds (basic_block bb,
void
sccvn_dom_walker::after_dom_children (basic_block bb)
{
if (unreachable_dom == bb)
unreachable_dom = NULL;
while (!cond_stack.is_empty ()
&& cond_stack.last ().first == bb)
{
......@@ -4325,10 +4330,14 @@ sccvn_dom_walker::before_dom_children (basic_block bb)
/* If any of the predecessor edges that do not come from blocks dominated
by us are still marked as possibly executable consider this block
reachable. */
bool reachable = bb == ENTRY_BLOCK_PTR_FOR_FN (cfun);
FOR_EACH_EDGE (e, ei, bb->preds)
if (!dominated_by_p (CDI_DOMINATORS, e->src, bb))
reachable |= (e->flags & EDGE_EXECUTABLE);
bool reachable = false;
if (!unreachable_dom)
{
reachable = bb == ENTRY_BLOCK_PTR_FOR_FN (cfun);
FOR_EACH_EDGE (e, ei, bb->preds)
if (!dominated_by_p (CDI_DOMINATORS, e->src, bb))
reachable |= (e->flags & EDGE_EXECUTABLE);
}
/* If the block is not reachable all outgoing edges are not
executable. Neither are incoming edges with src dominated by us. */
......@@ -4352,6 +4361,11 @@ sccvn_dom_walker::before_dom_children (basic_block bb)
e->flags &= ~EDGE_EXECUTABLE;
}
}
/* Record the most dominating unreachable block. */
if (!unreachable_dom)
unreachable_dom = bb;
return;
}
......
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