aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-06-25 18:38:14 +0000
committerSebastian Pop <sebastian.pop@amd.com>2010-06-25 18:38:14 +0000
commit2eef65e80f49acb40d94605271403e8fcb0b5d2c (patch)
tree7397dfd8fdb71bbd08d9b75bbb20ea4f22b9fef1 /gcc/tree-if-conv.c
parentf4acd56cd5eccc0dbf716bd2e6e395016f4f9c8a (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@161397 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index f200d480b59..80a53a807bb 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -175,7 +175,7 @@ init_bb_predicate (basic_block bb)
{
bb->aux = XNEW (struct bb_predicate_s);
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. */
@@ -203,6 +203,16 @@ free_bb_predicate (basic_block bb)
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
to the new variable. */
@@ -605,8 +615,7 @@ predicate_bbs (loop_p loop)
to be processed: skip it. */
if (bb == loop->latch)
{
- set_bb_predicate (loop->latch, boolean_true_node);
- set_bb_predicate_gimplified_stmts (loop->latch, NULL);
+ reset_bb_predicate (loop->latch);
continue;
}
@@ -680,7 +689,7 @@ predicate_bbs (loop_p loop)
}
/* 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
&& bb_predicate_gimplified_stmts (loop->latch) == NULL);