Bug 66981 - [graphite] delinearization of arrays
Summary: [graphite] delinearization of arrays
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: Sebastian Pop
URL:
Keywords: missed-optimization
Depends on:
Blocks: graphite
  Show dependency treegraph
 
Reported: 2015-07-23 21:16 UTC by Sebastian Pop
Modified: 2021-10-01 02:58 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pop 2015-07-23 21:16:17 UTC
Graphite needs to delinearize the memory accesses in this loop to do vectorization and parallelization:

$ cat s.c
void foo(unsigned char *in, unsigned char *out, int w, int h)
{
  unsigned int i, j;
  for (i = 0; i < 3*w*h; i++)
    for (j = 0; j < 3*w*h; j++)
      out[i*w+j] = in[(i*w+j)*3] + in[(i*w+j)*3+1] + in[(i*w+j)*3+2];
}

$ gcc -O3 -floop-parallelize-all s.c

Polly vectorizes this loop with vector factor 16.
Comment 1 Dominique d'Humieres 2015-07-23 21:39:48 UTC
Is this related to PR61000?
Comment 2 Sebastian Pop 2015-07-24 21:40:23 UTC
> Is this related to PR61000?

Yes. Also related to PR14741.