[PATCH] D57598: [VPLAN] Determine Vector Width programmatically.

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 13:48:17 PDT 2019


hsaito added a comment.

In D57598#1428062 <https://reviews.llvm.org/D57598#1428062>, @fpetrogalli wrote:

> I mostly changes to code to use the infrastructure that LLVM already provides to determine the vectorization factor.


Haven't gone through the LIT test yet, but the code addressed my concerns.



================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6108
+    if (!UserVF)
+      VF = determineVPlanVF(TTI->getRegisterBitWidth(true /* Vector*/), CM);
 
----------------
If the return value is always 2 or greater, we should replace lines 6099-6103 with assert for VF >= 2.
Else, we should move lines 6099-6103 below line 6108 and adjust the code and the comment accordingly.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6112
+    assert(isPowerOf2_32(VF) && "VF needs to be a power of two");
+    LLVM_DEBUG(dbgs() << "LV: Using user VF " << VF << ".\n");
+    buildVPlans(VF, VF);
----------------
This is no longer user VF. Should be something along the lines of
                "LV: Using " << UserVF ? "user VF " : "computed VF " << VF


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57598/new/

https://reviews.llvm.org/D57598





More information about the llvm-commits mailing list