This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Unrolling addressing optimization (re-submission)
Hello,
> > 1) why do you check for EXPR_LISTs there?
>
> Shift instructions include REG_EQUAL notes.
> Those notes are been retrieved just before testing for
> givness or calculating the stride:
>
> rhs = find_reg_equal_equiv_note (insn);
hmmm... a bug in loop-iv.c. This patch should fix it; I will send it
for review once it passes neccesary tests.
Zdenek
Index: loop-iv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-iv.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 loop-iv.c
*** loop-iv.c 18 Mar 2004 16:42:31 -0000 2.7
--- loop-iv.c 26 Apr 2004 11:55:17 -0000
*************** mark_single_set (rtx insn, rtx set)
*** 254,260 ****
unsigned regno, uid;
src = find_reg_equal_equiv_note (insn);
! if (!src)
src = SET_SRC (set);
if (!simple_set_p (SET_DEST (set), src))
--- 254,262 ----
unsigned regno, uid;
src = find_reg_equal_equiv_note (insn);
! if (src)
! src = XEXP (src, 0);
! else
src = SET_SRC (set);
if (!simple_set_p (SET_DEST (set), src))
*************** get_biv_step_1 (rtx insn, rtx reg,
*** 603,609 ****
set = single_set (insn);
rhs = find_reg_equal_equiv_note (insn);
! if (!rhs)
rhs = SET_SRC (set);
lhs = SET_DEST (set);
--- 605,613 ----
set = single_set (insn);
rhs = find_reg_equal_equiv_note (insn);
! if (rhs)
! rhs = XEXP (rhs, 0);
! else
rhs = SET_SRC (set);
lhs = SET_DEST (set);
*************** iv_analyze (rtx insn, rtx def, struct rt
*** 979,985 ****
set = single_set (insn);
rhs = find_reg_equal_equiv_note (insn);
! if (!rhs)
rhs = SET_SRC (set);
code = GET_CODE (rhs);
--- 983,991 ----
set = single_set (insn);
rhs = find_reg_equal_equiv_note (insn);
! if (rhs)
! rhs = XEXP (rhs, 0);
! else
rhs = SET_SRC (set);
code = GET_CODE (rhs);
*************** simplify_using_assignment (rtx insn, rtx
*** 1337,1343 ****
return;
rhs = find_reg_equal_equiv_note (insn);
! if (!rhs)
rhs = SET_SRC (set);
if (!simple_rhs_p (rhs))
--- 1343,1351 ----
return;
rhs = find_reg_equal_equiv_note (insn);
! if (rhs)
! rhs = XEXP (rhs, 0);
! else
rhs = SET_SRC (set);
if (!simple_rhs_p (rhs))