[PATCH] D101726: [LV] Account for tripcount when calculation vectorization profitability

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 4 13:29:14 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5890
+
+  if (FoldTailByMasking && MaxTripCount) {
+    // If we are folding the tail and the trip count is a known (possibly small)
----------------
I think this only makes sense if both factors are fixed-width VFs?
If so, please add this as a condition and use `getFixedValue()` in the cost-calculation.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5895
+    uint64_t RTCostA =
+        CostA * divideCeil(MaxTripCount, A.Width.getKnownMinValue());
+    uint64_t RTCostB =
----------------
should this be `B` (and the one below be `A`)?


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

https://reviews.llvm.org/D101726



More information about the llvm-commits mailing list