[PATCH] D22952: [LoopVectorize] Detect loops in the innermost loop before creating InnerLoopVectorizer

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 23:08:51 PDT 2016


chandlerc added a comment.

In https://reviews.llvm.org/D22952#503046, @anemet wrote:

> I guess it all depends on whether you think these checks are similar or not.  I don't really see the difference between loops and cycles.  For example, when I look at the testcase in C, I essentially see two nested loops even though the inner one is a bit weird (I guess it's multi-entry).  I am not sure that it make sense to differentiate the two to the user either.
>
> Thus I'd like to have a single place where we check for the inner-most loop property (with LoopInfo and beyond) and where we properly report back to the user.  This is currently addInnerLoop.  (The other place is dead before the patch, AFAICT.)


At a somewhat fundamental level, LLVM uses the term "loop" to mean "natural loop", and not any arbitrary cycle. Similarly, throughout LoopInfo and the loop pass manager we model "inner loop" as the innermost natural loop, regardless of whether there are cycles nested within it.

So while I don't have a really strong opinion about how the vectorizer is factored (I don't really work on it) I would expect an LLVM API spelled "addInnerLoop" to mean "add inner natural loop" and not "add inner cycle which happens to be a natural loop" or "add inner loop that doesn't contain a cycle".

It is possible we could work to change LLVM's terminology, but I think that'd be a pretty big shift. So, if you want to filter these things in "addInnerLoop" I'd suggest trying to find a more precise name.


https://reviews.llvm.org/D22952





More information about the llvm-commits mailing list