[LV] Clarify uniform worklist contains instrs demanding lane 0.
authorFlorian Hahn <flo@fhahn.com>
Thu, 4 Nov 2021 12:11:17 +0000 (13:11 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 4 Nov 2021 12:11:50 +0000 (13:11 +0100)
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

index 1c6f252..b1c98ae 100644 (file)
@@ -5379,12 +5379,14 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
     return (!I || !TheLoop->contains(I));
   };
 
+  // Worklist containing uniform instructions demanding lane 0.
   SetVector<Instruction *> Worklist;
   BasicBlock *Latch = TheLoop->getLoopLatch();
 
-  // Instructions that are scalar with predication must not be considered
-  // uniform after vectorization, because that would create an erroneous
-  // replicating region where only a single instance out of VF should be formed.
+  // Add uniform instructions demanding lane 0 to the worklist. Instructions
+  // that are scalar with predication must not be considered uniform after
+  // vectorization, because that would create an erroneous replicating region
+  // where only a single instance out of VF should be formed.
   // TODO: optimize such seldom cases if found important, see PR40816.
   auto addToWorklistIfAllowed = [&](Instruction *I) -> void {
     if (isOutOfScope(I)) {