This is the mail archive of the
mailing list for the GCC project.
RE: Your change
- From: "Lu, Hongjiu" <hongjiu dot lu at intel dot com>
- To: "Vladimir Makarov" <vmakarov at redhat dot com>, <mark at codesourcery dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Wed, 23 Jul 2003 08:22:48 -0700
- Subject: RE: Your change
There are 2 separate issues:
1. When I look at the RTL dump from -O1, the compiler does want
conditionally execute prefetch. It was just that the ia64 backend
ignored that request.
2. When -O2, prefetch will be executed speculatively. In that case,
compiler wants to execute prefetch unconditionally.
#2 was never a problem. The problem is #1.
> -----Original Message-----
> From: Vladimir Makarov [mailto:email@example.com]
> Sent: Wednesday, July 23, 2003 7:12 AM
> To: firstname.lastname@example.org
> Cc: Lu, Hongjiu; email@example.com
> Subject: Re: Your change
> Mark Mitchell wrote:
> > HJ --
> > I did not approve this change for the 3.3 branch, so far as I can
> > tell.
> > 2003-07-21 H.J. Lu <firstname.lastname@example.org>
> > PR optimization/11599
> > * config/ia64/ia64.md (prefetch): Support predicate.
> > If I did approve, and I have simply become addled, then you should
> > disregard the remainder of this message, and accept my apologies.
> > In this particular case, the patch is OK.
> Actually, the patch is bad and the solution of the problem (if there
> a problem) is ugly. There are a lot of reasons for this:
> 1. It changes semantics of the prefetch pattern. The documentation
> that prefetch is not a trap insn. It means that it can be executed
> speculatively. So the change of semantics is not reflected in the
> 2. It changes semantics of the prefetch only for one port. Which is
> even worse because the portability hurts.
> 3. The test code for ia64 has different meaning depending on what
> optimizations are used. That is the most horrible thing. The solution
> works only for -O0 or -O1. If the -O2 is used, the prefetch will be
> executed for any parameter value because the 1st insn scheduling (-O2)
> will make speculative move of insn. There is no easy way to say the
> scheduler that there is dependence between the branch and the
> Taking all this into account, I believe the patch should be removed.
> see the following two solutions for the problem.
> 1. The simple one is to use asm (with ia64 lprefetch inside it)
> of the builtin prefetch if somebody needs non-speculative prefetch.
> 2. Make prefetch pattern non-speculative, reflect it in the
> documentation, inform the insn scheduler about it. The last thing
> be done in a machine-independent way (in scheduler itself) or in a
> machine-dependent way (through reorder hooks) for all ports.
> I'd prefer the 1st solution.