Commit 29caa68a by Sebastian Pop Committed by Sebastian Pop

Use reset_bb_predicate whenever the predicate of a BB should be reset to true.

2010-06-25  Sebastian Pop  <sebastian.pop@amd.com>

	* tree-if-conv.c (init_bb_predicate): Initialize the predicate
	to boolean_true_node.
	(reset_bb_predicate): New.
	(predicate_bbs): Call reset_bb_predicate.

From-SVN: r161397
parent 0f741287
2010-06-25 Sebastian Pop <sebastian.pop@amd.com> 2010-06-25 Sebastian Pop <sebastian.pop@amd.com>
* tree-if-conv.c (init_bb_predicate): Initialize the predicate
to boolean_true_node.
(reset_bb_predicate): New.
(predicate_bbs): Call reset_bb_predicate.
2010-06-25 Sebastian Pop <sebastian.pop@amd.com>
* tree-if-conv.c (combine_blocks): Remove FIXME comment. * tree-if-conv.c (combine_blocks): Remove FIXME comment.
(tree_if_conversion): Returns true when something has been changed. (tree_if_conversion): Returns true when something has been changed.
(main_tree_if_conversion): Return TODO_cleanup_cfg when if-conversion (main_tree_if_conversion): Return TODO_cleanup_cfg when if-conversion
......
...@@ -175,7 +175,7 @@ init_bb_predicate (basic_block bb) ...@@ -175,7 +175,7 @@ init_bb_predicate (basic_block bb)
{ {
bb->aux = XNEW (struct bb_predicate_s); bb->aux = XNEW (struct bb_predicate_s);
set_bb_predicate_gimplified_stmts (bb, NULL); set_bb_predicate_gimplified_stmts (bb, NULL);
set_bb_predicate (bb, NULL_TREE); set_bb_predicate (bb, boolean_true_node);
} }
/* Free the predicate of basic block BB. */ /* Free the predicate of basic block BB. */
...@@ -203,6 +203,16 @@ free_bb_predicate (basic_block bb) ...@@ -203,6 +203,16 @@ free_bb_predicate (basic_block bb)
bb->aux = NULL; bb->aux = NULL;
} }
/* Free the predicate of BB and reinitialize it with the true
predicate. */
static inline void
reset_bb_predicate (basic_block bb)
{
free_bb_predicate (bb);
init_bb_predicate (bb);
}
/* Create a new temp variable of type TYPE. Add GIMPLE_ASSIGN to assign EXP /* Create a new temp variable of type TYPE. Add GIMPLE_ASSIGN to assign EXP
to the new variable. */ to the new variable. */
...@@ -605,8 +615,7 @@ predicate_bbs (loop_p loop) ...@@ -605,8 +615,7 @@ predicate_bbs (loop_p loop)
to be processed: skip it. */ to be processed: skip it. */
if (bb == loop->latch) if (bb == loop->latch)
{ {
set_bb_predicate (loop->latch, boolean_true_node); reset_bb_predicate (loop->latch);
set_bb_predicate_gimplified_stmts (loop->latch, NULL);
continue; continue;
} }
...@@ -680,7 +689,7 @@ predicate_bbs (loop_p loop) ...@@ -680,7 +689,7 @@ predicate_bbs (loop_p loop)
} }
/* The loop header is always executed. */ /* The loop header is always executed. */
set_bb_predicate (loop->header, boolean_true_node); reset_bb_predicate (loop->header);
gcc_assert (bb_predicate_gimplified_stmts (loop->header) == NULL gcc_assert (bb_predicate_gimplified_stmts (loop->header) == NULL
&& bb_predicate_gimplified_stmts (loop->latch) == NULL); && bb_predicate_gimplified_stmts (loop->latch) == NULL);
......
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