[llvm] [LoopVectorize] Improve Vectorization of Low Trip Count Loops (PR #195823)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 00:48:11 PDT 2026


================
@@ -5871,6 +5893,12 @@ LoopVectorizationPlanner::computeBestVF() {
     if (ConsiderRegPressure)
       RUs = calculateRegisterUsageForPlan(*P, VFs, TTI);
 
+    if (!ForceVectorization && P->hasScalarTail() && ExactTC.isFixed() &&
----------------
sdesmalen-arm wrote:

This needs a comment explaining why it does what it does.
(and I would recommend a FIXME to encode this explicitly in the LVPlanner, rather than deducing it purely from `ExactTC.getFixedValue() <= TTI.getMinTripCountTailFoldingThreshold()`)

https://github.com/llvm/llvm-project/pull/195823


More information about the llvm-commits mailing list