Commit 13cf6837 by Daniel Berlin Committed by Daniel Berlin

lambda-code.c (lambda_loopnest_to_gcc_loopnest): Swap the test when the edge has…

lambda-code.c (lambda_loopnest_to_gcc_loopnest): Swap the test when the edge has the opposite meaning...

2004-11-16  Daniel Berlin  <dberlin@dberlin.org>

	* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Swap
	the test when the edge has the opposite meaning, not when
	the first argument is invariant.

From-SVN: r90788
parent 354ed18f
2004-11-16 Daniel Berlin <dberlin@dberlin.org>
* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Swap
the test when the edge has the opposite meaning, not when
the first argument is invariant.
2004-11-16 Aldy Hernandez <aldyh@redhat.com> 2004-11-16 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.c (rs6000_override_options): Split e500v2 * config/rs6000/rs6000.c (rs6000_override_options): Split e500v2
......
...@@ -1867,6 +1867,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, ...@@ -1867,6 +1867,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
{ {
lambda_loop newloop; lambda_loop newloop;
basic_block bb; basic_block bb;
edge exit;
tree ivvar, ivvarinced, exitcond, stmts; tree ivvar, ivvarinced, exitcond, stmts;
enum tree_code testtype; enum tree_code testtype;
tree newupperbound, newlowerbound; tree newupperbound, newlowerbound;
...@@ -1908,6 +1909,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, ...@@ -1908,6 +1909,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
type, type,
new_ivs, new_ivs,
invariants, MIN_EXPR, &stmts); invariants, MIN_EXPR, &stmts);
exit = temp->single_exit;
exitcond = get_loop_exit_condition (temp); exitcond = get_loop_exit_condition (temp);
bb = bb_for_stmt (exitcond); bb = bb_for_stmt (exitcond);
bsi = bsi_start (bb); bsi = bsi_start (bb);
...@@ -1928,12 +1930,11 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, ...@@ -1928,12 +1930,11 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
testtype = LL_STEP (newloop) >= 0 ? LE_EXPR : GE_EXPR; testtype = LL_STEP (newloop) >= 0 ? LE_EXPR : GE_EXPR;
/* Since we don't know which cond_expr part currently points to each /* We want to build a conditional where true means exit the loop, and
edge, check which one is invariant and make sure we reverse the false means continue the loop.
comparison if we are trying to replace a <= 50 with 50 >= newiv. So swap the testtype if this isn't the way things are.*/
This ensures that we still canonicalize to <invariant> <test>
<induction variable>. */ if (exit->flags & EDGE_FALSE_VALUE)
if (!expr_invariant_in_loop_p (temp, TREE_OPERAND (exitcond, 0)))
testtype = swap_tree_comparison (testtype); testtype = swap_tree_comparison (testtype);
COND_EXPR_COND (exitcond) = build (testtype, COND_EXPR_COND (exitcond) = build (testtype,
......
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