public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45022]  New: No prefetch for the vectorized loop
@ 2010-07-21 18:04 changpeng dot fang at amd dot com
  2010-07-21 18:06 ` [Bug tree-optimization/45022] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-07-21 18:04 UTC (permalink / raw)
  To: gcc-bugs

For the following test case, if we compile with -O3 -fprefetch-loop-arrays
-march=amdfam10, the loop is versioned (for runtime alias checking) to be
vectorized. However, we see prefetches in the non-vectorize version, but
not in the vectorized version.

void foo(int beta, float *a, float *b)
{
  int i;
  for(i=0; i<1024; i++)
     a[i] = a[i] + beta * b[i];
}

For the vectorized loop, in tree-ssa-loop-arrays.c (idx_analyze_ref):
 if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF
      || TREE_CODE (base) == ALIGN_INDIRECT_REF)
    return false;

FALSE is returned due to mis-aligned indirect reference:
M*vect_p.18_61{misalignment: 0}
M*vect_p.23_66{misalignment: 0}
M*vect_p.31_74{misalignment: 0}


-- 
           Summary: No prefetch for the vectorized loop
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: changpeng dot fang at amd dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45022


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/45022] No prefetch for the vectorized loop
  2010-07-21 18:04 [Bug tree-optimization/45022] New: No prefetch for the vectorized loop changpeng dot fang at amd dot com
@ 2010-07-21 18:06 ` rguenth at gcc dot gnu dot org
  2010-07-22 20:52 ` changpeng dot fang at amd dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-21 18:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-07-21 18:06 -------
The misaligned indirect-refs will vanish soon.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45022


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/45022] No prefetch for the vectorized loop
  2010-07-21 18:04 [Bug tree-optimization/45022] New: No prefetch for the vectorized loop changpeng dot fang at amd dot com
  2010-07-21 18:06 ` [Bug tree-optimization/45022] " rguenth at gcc dot gnu dot org
@ 2010-07-22 20:52 ` changpeng dot fang at amd dot com
  2010-07-22 21:17 ` rakdver at kam dot mff dot cuni dot cz
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-07-22 20:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from changpeng dot fang at amd dot com  2010-07-22 20:52 -------
(In reply to comment #1)
> The misaligned indirect-refs will vanish soon.
> 

>From the prefetching point of view, is there any reason that we can not
prefetch
for mis-aligned or indirect refs?  <I understand that prefetching for indirect
refs may be too aggressive>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45022


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/45022] No prefetch for the vectorized loop
  2010-07-21 18:04 [Bug tree-optimization/45022] New: No prefetch for the vectorized loop changpeng dot fang at amd dot com
  2010-07-21 18:06 ` [Bug tree-optimization/45022] " rguenth at gcc dot gnu dot org
  2010-07-22 20:52 ` changpeng dot fang at amd dot com
@ 2010-07-22 21:17 ` rakdver at kam dot mff dot cuni dot cz
  2010-07-29 19:14 ` changpeng dot fang at amd dot com
  2010-07-30  8:41 ` rguenther at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: rakdver at kam dot mff dot cuni dot cz @ 2010-07-22 21:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rakdver at kam dot mff dot cuni dot cz  2010-07-22 21:17 -------
Subject: Re:  No prefetch for the vectorized
        loop

> ------- Comment #2 from changpeng dot fang at amd dot com  2010-07-22 20:52 -------
> (In reply to comment #1)
> > The misaligned indirect-refs will vanish soon.
> > 
> 
> >From the prefetching point of view, is there any reason that we can not
> prefetch
> for mis-aligned or indirect refs?  <I understand that prefetching for indirect
> refs may be too aggressive>

we do prefetching for indirect refs.  As for mis-aligned refs, I was a bit
worried
that perhaps on some architectures, taking their address might not be valid;
but
it is likely that I am mistaken on this.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45022


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/45022] No prefetch for the vectorized loop
  2010-07-21 18:04 [Bug tree-optimization/45022] New: No prefetch for the vectorized loop changpeng dot fang at amd dot com
                   ` (2 preceding siblings ...)
  2010-07-22 21:17 ` rakdver at kam dot mff dot cuni dot cz
@ 2010-07-29 19:14 ` changpeng dot fang at amd dot com
  2010-07-30  8:41 ` rguenther at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-07-29 19:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from changpeng dot fang at amd dot com  2010-07-29 19:14 -------
(In reply to comment #1)
> The misaligned indirect-refs will vanish soon.
> 

I saw your patch that remove ALIGNED_INDIRECT_REF. Do you also plan to remove
MISALIGNED_INDIRECT_REF? Thanks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45022


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/45022] No prefetch for the vectorized loop
  2010-07-21 18:04 [Bug tree-optimization/45022] New: No prefetch for the vectorized loop changpeng dot fang at amd dot com
                   ` (3 preceding siblings ...)
  2010-07-29 19:14 ` changpeng dot fang at amd dot com
@ 2010-07-30  8:41 ` rguenther at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: rguenther at suse dot de @ 2010-07-30  8:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenther at suse dot de  2010-07-30 08:41 -------
Subject: Re:  No prefetch for the vectorized
 loop

On Thu, 29 Jul 2010, changpeng dot fang at amd dot com wrote:

> ------- Comment #4 from changpeng dot fang at amd dot com  2010-07-29 19:14 -------
> (In reply to comment #1)
> > The misaligned indirect-refs will vanish soon.
> > 
> 
> I saw your patch that remove ALIGNED_INDIRECT_REF. Do you also plan to remove
> MISALIGNED_INDIRECT_REF? Thanks.

Yes.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45022


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-30  8:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-21 18:04 [Bug tree-optimization/45022] New: No prefetch for the vectorized loop changpeng dot fang at amd dot com
2010-07-21 18:06 ` [Bug tree-optimization/45022] " rguenth at gcc dot gnu dot org
2010-07-22 20:52 ` changpeng dot fang at amd dot com
2010-07-22 21:17 ` rakdver at kam dot mff dot cuni dot cz
2010-07-29 19:14 ` changpeng dot fang at amd dot com
2010-07-30  8:41 ` rguenther at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).