[PATCH] D86452: [LV] Fix scalar cost for tail predicated loops

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 04:26:25 PDT 2020


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5930
+    // cost by the probability of executing it.
+    if (VF == 1 && Legal->blockNeedsPredication(BB))
       BlockCost.first /= getReciprocalPredBlockProb();
----------------
might be worth adding a note here that we do intentionally not use `LoopVectorizationCostModel::blockNeedsPredication`, this also returns true if predication is required due to folding the tail by masking.


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

https://reviews.llvm.org/D86452



More information about the llvm-commits mailing list