Commit 3aa94dc8 by Jeffrey A Law Committed by Jeff Law

loop.c (check_dbra_loop): The loop ending comparison value must be an invariant…

loop.c (check_dbra_loop): The loop ending comparison value must be an invariant or we can not reverse the...

        * loop.c (check_dbra_loop): The loop ending comparison value
        must be an invariant or we can not reverse the loop.

From-SVN: r22045
parent 78b87d18
Thu Aug 27 20:10:46 1998 Jeffrey A Law (law@cygnus.com) Thu Aug 27 20:10:46 1998 Jeffrey A Law (law@cygnus.com)
* loop.c (check_dbra_loop): The loop ending comparison value
must be an invariant or we can not reverse the loop.
* loop.c (scan_loop): Count down from max_reg_num - 1 to * loop.c (scan_loop): Count down from max_reg_num - 1 to
FIRST_PSEUDO_REGISTER to avoid calling max_reg_num each iteration FIRST_PSEUDO_REGISTER to avoid calling max_reg_num each iteration
of the loop. of the loop.
......
...@@ -6904,6 +6904,15 @@ check_dbra_loop (loop_end, insn_count, loop_start) ...@@ -6904,6 +6904,15 @@ check_dbra_loop (loop_end, insn_count, loop_start)
comparison_sign_mask comparison_sign_mask
= (unsigned HOST_WIDE_INT)1 << (comparison_const_width - 1); = (unsigned HOST_WIDE_INT)1 << (comparison_const_width - 1);
/* If the comparison value is not a loop invariant, then we
can not reverse this loop.
??? If the insns which initialize the comparison value as
a whole compute an invariant result, then we could move
them out of the loop and proceed with loop reversal. */
if (!invariant_p (comparison_val))
return 0;
if (GET_CODE (comparison_value) == CONST_INT) if (GET_CODE (comparison_value) == CONST_INT)
comparison_val = INTVAL (comparison_value); comparison_val = INTVAL (comparison_value);
initial_value = bl->initial_value; initial_value = bl->initial_value;
......
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