This is the mail archive of the gcc-patches@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: [patch] PR44185 Fix new prefetch test failures


________________________________________
From: Zdenek Dvorak [rakdver@kam.mff.cuni.cz]
Sent: Tuesday, May 18, 2010 3:00 PM
To: Fang, Changpeng
Cc: H.J. Lu; gcc-patches@gcc.gnu.org; rguenther@suse.de; sebpop@gmail.com
Subject: Re: [patch] PR44185 Fix new prefetch test failures

Hi,

>> Attached is the patch that fixes PR 44184: new prefetch test failure.
>> For gcc.dg/tree-ssa/prefetch-6.c, we add --param min-insn-to-prefetch-ratio=6 to generate
>> the desired number of prefetches.

>the need to change this testcase looks somewhat strange -- it seems to me that the loops should
>be unrolled enough so that min-insn-to-prefetch-ratio does not come into play.  What is happening
>there?

Here are the first and last loops in prefetch-6.c: 

 /* Here, we should use non-temporal prefetch instruction.  */
  for (i = 0; i < K; i++)
    for (j = 0; j < K; j++)
      sum += a[i][j];

  /* Temporal prefetches should be used here (even though the accesses to
     a[j][i] are independent, the same cache line is almost always hit
     every N iterations).  */
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++)
      sum += a[j][i];

The first loop is ok because it has been unrolled. For the second loop it is not unrolled because no "self" reuse.
Of course, for the second loop, I expect loop interchange happens (with -ftree-loop-linear).

Thanks,

Changpeng






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