This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: enabling 1st insn scheduling for sh4.
- From: DJ Delorie <dj at redhat dot com>
- To: vmakarov at redhat dot com
- Cc: rth at redhat dot com, gcc-patches at gcc dot gnu dot org, skg at cradle dot com
- Date: Wed, 3 Mar 2004 19:23:25 -0500
- Subject: Re: Patch: enabling 1st insn scheduling for sh4.
- References: <403B8B1B.5000606@redhat.com> <200402260522.i1Q5MVOr025640@greed.delorie.com> <20040226054723.GB24218@redhat.com> <200402260609.i1Q69axa026294@greed.delorie.com> <200402260622.i1Q6MHwt029125@greed.delorie.com> <403E3980.9070004@redhat.com> <200403012044.i21KixGT026223@greed.delorie.com> <40466CDC.9030705@redhat.com>
> Thanks, DJ. I tought about a solution. I think that insn changing
> stack pointer is more preferable than one using it (because in the
> second case there is bigger probability that insn which is not really a
> part of call sequence will be a part of the schedule group). So the
> patch should insert the insn changing the stack pointer into the
> schedule group.
>
> I could write the patch and submit it on Friday. In this case somebody
> should review it. If you prefer to write the patch yourself, I review
> and approve it as soon as I get it. What do you prefer?
My original patch only checked for stack adjustments, not any stack
usage. I've tweaked it a bit to be clearer what it's trying to test
for:
Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.68
diff -p -C2 -r1.68 sched-deps.c
*** sched-deps.c 3 Feb 2004 05:39:53 -0000 1.68
--- sched-deps.c 26 Feb 2004 06:20:32 -0000
*************** sched_analyze_insn (struct deps *deps, r
*** 1128,1132 ****
if (GET_CODE (tmp) == SUBREG)
tmp = SUBREG_REG (tmp);
! if (GET_CODE (tmp) == REG)
src_regno = REGNO (tmp);
else
--- 1128,1137 ----
if (GET_CODE (tmp) == SUBREG)
tmp = SUBREG_REG (tmp);
! if (GET_CODE (tmp) == PLUS
! && GET_CODE (XEXP (tmp, 0)) == REG
! && REGNO (XEXP (tmp, 0)) == STACK_POINTER_REGNUM
! && dest_regno == STACK_POINTER_REGNUM)
! src_regno = STACK_POINTER_REGNUM;
! else if (GET_CODE (tmp) == REG)
src_regno = REGNO (tmp);
else