Commit 1b7cd4a5 by Kazu Hirata Committed by Kazu Hirata

tree-if-conv.c (tree_if_convert_cond_expr): Remove two "if" statements that always trigger.

	* tree-if-conv.c (tree_if_convert_cond_expr): Remove two "if"
	statements that always trigger.

From-SVN: r90267
parent f7b529fa
2004-11-08 Kazu Hirata <kazu@cs.umass.edu> 2004-11-08 Kazu Hirata <kazu@cs.umass.edu>
* tree-if-conv.c (tree_if_convert_cond_expr): Remove two "if"
statements that always trigger.
2004-11-08 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c, tree-if-conv.c, tree-into-ssa.c, * tree-cfg.c, tree-if-conv.c, tree-into-ssa.c,
tree-scalar-evolution.c, tree-ssa-loop-im.c, tree-scalar-evolution.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa.c,
......
...@@ -271,7 +271,7 @@ static void ...@@ -271,7 +271,7 @@ static void
tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond, tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond,
block_stmt_iterator *bsi) block_stmt_iterator *bsi)
{ {
tree then_clause, else_clause, c, new_cond; tree then_clause, else_clause, c, c2, new_cond;
new_cond = NULL_TREE; new_cond = NULL_TREE;
gcc_assert (TREE_CODE (stmt) == COND_EXPR); gcc_assert (TREE_CODE (stmt) == COND_EXPR);
...@@ -290,14 +290,11 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond, ...@@ -290,14 +290,11 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond,
} }
/* Add new condition into destination's predicate list. */ /* Add new condition into destination's predicate list. */
if (then_clause)
/* if 'c' is true then then_clause is reached. */ /* If 'c' is true then then_clause is reached. */
new_cond = add_to_dst_predicate_list (loop, then_clause, cond, new_cond = add_to_dst_predicate_list (loop, then_clause, cond,
unshare_expr (c), bsi); unshare_expr (c), bsi);
if (else_clause)
{
tree c2;
if (!is_gimple_reg(c) && is_gimple_condexpr (c)) if (!is_gimple_reg(c) && is_gimple_condexpr (c))
{ {
tree new_stmt; tree new_stmt;
...@@ -306,10 +303,9 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond, ...@@ -306,10 +303,9 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond,
c = TREE_OPERAND (new_stmt, 0); c = TREE_OPERAND (new_stmt, 0);
} }
/* if 'c' is false then else_clause is reached. */ /* If 'c' is false then else_clause is reached. */
c2 = invert_truthvalue (unshare_expr (c)); c2 = invert_truthvalue (unshare_expr (c));
add_to_dst_predicate_list (loop, else_clause, cond, c2, bsi); add_to_dst_predicate_list (loop, else_clause, cond, c2, bsi);
}
/* Now this conditional statement is redundant. Remove it. /* Now this conditional statement is redundant. Remove it.
But, do not remove exit condition! Update exit condition But, do not remove exit condition! Update exit condition
......
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