forked from OSchip/llvm-project
9f57c5b695
Fix inspired from c2d4a0627e95c34a819b9d4ffb4db62daa78dade. Given the following code for (i = 0; i < 10; i++) { ; } S: A[i] = 0 When translate the data reference A[i] in statement S using scev, we need to retrieve the scev of 'i' at the location of 'S'. If we do not do this the scev that we obtain will be expressed as {0,+,1}_for and will reference loop iterators that do not surround 'S'. What we really want is the scev to be instantiated to the value of 'i' after the loop. This value is {10}. This used to crash in: int loopDimension = getLoopDepth(Expr->getLoop()); isl_aff *LAff = isl_aff_set_coefficient_si( isl_aff_zero_on_domain(LocalSpace), isl_dim_in, loopDimension, 1); (gdb) p Expr->dump() {8,+,8}<nw><%do.body> (gdb) p getLoopDepth(Expr->getLoop()) $5 = 0 isl_space *Space = isl_space_set_alloc(Ctx, 0, NbLoopSpaces); isl_local_space *LocalSpace = isl_local_space_from_space(Space); As we are trying to create a memory access in a stmt that is outside all loops, LocalSpace has 0 dimensions: (gdb) p NbLoopSpaces $12 = 0 (gdb) p Statement.BB->dump() if.then: ; preds = %do.end %0 = load float* %add.ptr, align 4 store float %0, float* %q.1.reg2mem, align 4 br label %if.end.single_exit and so the scev for %add.ptr should be taken at the place where it is used, i.e., it should be the value on the last iteration of the do.body loop, and not "{8,+,8}<nw><%do.body>". llvm-svn: 179148 |
||
---|---|---|
.. | ||
Cloog | ||
CodePreparation | ||
Dependences | ||
IndependentBlocks | ||
Isl | ||
ScheduleOptimizer | ||
ScopDetect | ||
ScopInfo | ||
TempScop | ||
polybench | ||
CMakeLists.txt | ||
Makefile | ||
README | ||
create_ll.sh | ||
lit.cfg | ||
lit.site.cfg.in | ||
polly.ll |
README
place tests here