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 |
||
---|---|---|
.. | ||
autoconf | ||
cmake | ||
docs | ||
include | ||
lib | ||
test | ||
tools | ||
utils | ||
www | ||
.gitattributes | ||
CMakeLists.txt | ||
CREDITS.txt | ||
LICENSE.txt | ||
Makefile | ||
Makefile.common.in | ||
Makefile.config.in | ||
README | ||
configure |
README
Polly - Polyhedral optimizations for LLVM ----------------------------------------- http://polly.llvm.org/ Polly uses a mathematical representation, the polyhedral model, to represent and transform loops and other control flow structures. Using an abstract representation it is possible to reason about transformations in a more general way and to use highly optimized linear programming libraries to figure out the optimal loop structure. These transformations can be used to do constant propagation through arrays, remove dead loop iterations, optimize loops for cache locality, optimize arrays, apply advanced automatic parallelization, drive vectorization, or they can be used to do software pipelining.