Commit 1f1e8172 by Jim Wilson

(loop_iterations): When computing comparison_value, use

reg_set_p to identify instructions that modify it.

From-SVN: r4036
parent fdd79c58
...@@ -3039,14 +3039,19 @@ loop_iterations (loop_start, loop_end) ...@@ -3039,14 +3039,19 @@ loop_iterations (loop_start, loop_end)
break; break;
else if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' else if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& (set = single_set (insn)) && reg_set_p (comparison_value, insn))
&& (SET_DEST (set) == comparison_value))
{ {
rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX); /* We found the last insn before the loop that sets the register.
If it sets the entire register, and has a REG_EQUAL note,
if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST) then use the value of the REG_EQUAL note. */
comparison_value = XEXP (note, 0); if ((set = single_set (insn))
&& (SET_DEST (set) == comparison_value))
{
rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
comparison_value = XEXP (note, 0);
}
break; break;
} }
} }
......
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