[PATCH] D13529: [Polly] Allow alloca instructions in the SCoP

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 15:41:58 PDT 2015


Meinersbur added a comment.

alloca is most definitely not like any other instruction. When placed in a loop, the stack will grow in every iteration an eventually lead to a stack overflow. Such code is more than evil. How did you even manage to make Clang output such code? It should also have added stacksave/stackrestore intrinsics.

The question is, whether it matters for Polly. How does it handle the situation that %B refers to different memory in every iteration? Are there infinitely many arrays in the scop, since there are infinitely many base addresses? Are base addresses that are variant within the scop even valid?

Since the semantics of allocas in loops are dangerous and there is probably no valid use for them without stackrestore, I strongly recommend against this.


http://reviews.llvm.org/D13529





More information about the llvm-commits mailing list