forked from OSchip/llvm-project
e42ddb9ad3
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 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
GICHelper.cpp | ||
Makefile | ||
SCEVValidator.cpp | ||
ScopHelper.cpp |