[PATCH] D112552: [LoopVectorize] When tail-folding, don't always predicate uniform loads

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 31 13:10:06 PDT 2021


fhahn requested changes to this revision.
fhahn added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9070
+  if (IsUniform && isa<LoadInst>(I) &&
+      !Legal->blockNeedsPredication(I->getParent()) && Range.Start.isVector()) {
+    assert(CM.foldTailByMasking() &&
----------------
The problem with the workaround is that `IsPredicated` is now inaccurate for the recipe I think.

It looks like the cost-model already accurately estimates the cost as not requiring predication. So perhaps it would be better to not claim the instruction requires predication in the first place in `LoopVectorizationCostModel::isPredicated`?


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

https://reviews.llvm.org/D112552



More information about the llvm-commits mailing list