This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


H.J. Lu
Intel Corporation


> -----Original Message-----
> From: Vladimir Makarov [mailto:vmakarov@redhat.com]
> Sent: Wednesday, July 23, 2003 7:12 AM
> To: mark@codesourcery.com
> Cc: Lu, Hongjiu; gcc@gcc.gnu.org
> 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 <hongjiu.lu@intel.com>
> >
> >           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
> is
> a problem) is ugly.  There are a lot of reasons for this:
> 
> 1. It changes semantics of the prefetch pattern.  The documentation
> says
> 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
> documentation.
> 
> 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
> insn
> scheduler that there is dependence between the branch and the
> prefetch.
> 
> Taking all this into account, I believe the patch should be removed.
> I
> see the following two solutions for the problem.
> 
> 1.  The simple one is to use asm (with ia64 lprefetch inside it)
> instead
> 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
> could
> 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.
> 
> Vlad


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]