This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -fprefetch-loop-arrays on PowerPC
- From: Jan Hubicka <jh at suse dot cz>
- To: Andreas Conz <andreasc at neuro dot informatik dot uni-kassel dot de>,rth at cygnus dot com, mark at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- Cc: Jan Hubicka <jh at suse dot cz>
- Date: Sun, 2 Jun 2002 22:51:16 +0200
- Subject: Re: -fprefetch-loop-arrays on PowerPC
- References: <20020531123336.GA24188@atrey.karlin.mff.cuni.cz> <Pine.A41.4.44.0206022231510.54866-100000@nick-5.neuro.informatik.uni-kassel.de>
> On Fri, 31 May 2002, Jan Hubicka wrote:
>
> > Did it work?
>
> Yes.
>
Hi,
would be OK to install this patch for both mainline and branch?
Mark: the problem is not regression, but it is important problem in
-fprefetch-loop-arrays - on architectures that do not allow offsetting
of addresses it prefetch random blocks of memory. The patch is safe in
a way that it touches code not executed unless this switch is used.
Honza
Tue May 28 11:49:18 CEST 2002 Jan Hubicka <jh@ssue.cz>
* loop.c (emit_prefetch_instructions): Properly place the address computation.
*** loop.c.old Tue May 28 11:43:34 2002
--- loop.c Tue May 28 11:45:07 2002
*************** emit_prefetch_instructions (loop)
*** 4139,4144 ****
--- 4139,4145 ----
int bytes_ahead = PREFETCH_BLOCK * (ahead + y);
rtx before_insn = info[i].giv->insn;
rtx prev_insn = PREV_INSN (info[i].giv->insn);
+ rtx seq;
/* We can save some effort by offsetting the address on
architectures with offsettable memory references. */
*************** emit_prefetch_instructions (loop)
*** 4153,4165 ****
loc = reg;
}
/* Make sure the address operand is valid for prefetch. */
if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
(loc, insn_data[(int)CODE_FOR_prefetch].operand[0].mode))
loc = force_reg (Pmode, loc);
! emit_insn_before (gen_prefetch (loc, GEN_INT (info[i].write),
! GEN_INT (3)),
! before_insn);
/* Check all insns emitted and record the new GIV
information. */
--- 4154,4169 ----
loc = reg;
}
+ start_sequence ();
/* Make sure the address operand is valid for prefetch. */
if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
(loc, insn_data[(int)CODE_FOR_prefetch].operand[0].mode))
loc = force_reg (Pmode, loc);
! emit_insn (gen_prefetch (loc, GEN_INT (info[i].write),
! GEN_INT (3)));
! seq = gen_sequence ();
! end_sequence ();
! emit_insn_before (seq, before_insn);
/* Check all insns emitted and record the new GIV
information. */