diff options
author | Tobias Grosser <tobias@grosser.es> | 2013-08-05 15:14:15 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2013-08-05 15:14:15 +0000 |
commit | e42ddb9ad32ec31d03fddb8678c369244843d813 (patch) | |
tree | d3bb2b70cf24200ea143619990bc7b15169ee501 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 5b4634576e807fe0d6531af40e91a47a71da4c97 (diff) | |
download | llvm-e42ddb9ad32ec31d03fddb8678c369244843d813.zip llvm-e42ddb9ad32ec31d03fddb8678c369244843d813.tar.gz llvm-e42ddb9ad32ec31d03fddb8678c369244843d813.tar.bz2 |
ScopInfo: Split start value from SCEVAddRecExpr to enable parameter sharing.
SCoP invariant parameters with the different start value would deter parameter
sharing. For example, when compiling the following C code:
void foo(float *input) {
for (long j = 0; j < 8; j++) {
// SCoP begin
for (long i = 0; i < 8; i++) {
float x = input[j * 64 + i + 1];
input[j * 64 + i] = x * x;
}
}
}
Polly would creat two parameters for these memory accesses:
p_0: {0,+,256}
p_2: {4,+,256}
[j * 64 + i + 1] => MemRef_input[o0] : 4o0 = p_1 + 4i0
[j * 64 + i] => MemRef_input[o0] : 4o0 = p_0 + 4i0
These parameters only differ from start value. To enable parameter sharing,
we split the start value from SCEVAddRecExpr, so they would share a single
parameter that always has zero start value:
p0: {0,+,256}<%for.cond1.preheader>
[j * 64 + i + 1] => MemRef_input[o0] : 4o0 = 4 + p_1 + 4i0
[j * 64 + i] => MemRef_input[o0] : 4o0 = p_0 + 4i0
Such translation can make the polly-dependence much faster.
Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 187728
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions