[PATCH] D42447: [LV][VPlan] Detect outer loops for explicit vectorization.

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 14:40:21 PDT 2018


dcaballe added a comment.

In https://reviews.llvm.org/D42447#1071162, @fhahn wrote:

> Thanks Diego and thanks for your patience! LGTM, but please wait a bit with committing, in case other people people want to raise any additional comments.


Thanks, Florian! I'll wait until Monday.



================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4947
   // We must have a single backedge.
-  if (TheLoop->getNumBackEdges() != 1) {
+  if (Lp->getNumBackEdges() != 1) {
     ORE->emit(createMissedAnalysis("CFGNotUnderstood")
----------------
javed.absar wrote:
> Can we not simply check for isLoopSimplifyForm() ?
Thanks for the comment, Javed!

I guess that `getNumBackEdges` is more efficient? `isLoopSimplifyForm` is checking `getLoopPreheader() && getLoopLatch() && hasDedicatedExits()` and, having a quick look, only the last one is more expensive than the `getNumBackEdges`.

In any case, please, note that this call was already there. I'm not adding it as part of this patch.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:8629
+
+  if (!EnableVPlanNativePath) {
+    DEBUG(dbgs() << "LV: Not vectorizing. VPlan-native path is disabled.");
----------------
fhahn wrote:
> I suppose we should never call processLoopInVPlanNativePath without the flag? Could this be an assertion?
Ok, thanks!


https://reviews.llvm.org/D42447





More information about the llvm-commits mailing list