[llvm] [LV] Relax high loop trip count threshold for deciding to interleave a loop (PR #67725)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 17:16:36 PDT 2023


================
@@ -5755,8 +5745,12 @@ LoopVectorizationCostModel::selectInterleaveCount(ElementCount VF,
   // the InterleaveCount as if vscale is '1', although if some information about
   // the vector is known (e.g. min vector size), we can make a better decision.
   if (BestKnownTC) {
-    MaxInterleaveCount =
-        std::min(*BestKnownTC / VF.getKnownMinValue(), MaxInterleaveCount);
+    if (InterleaveSmallLoopScalarReduction)
+      MaxInterleaveCount =
+          std::min(*BestKnownTC / VF.getKnownMinValue(), MaxInterleaveCount);
+    else
+      MaxInterleaveCount = std::min(*BestKnownTC / (VF.getKnownMinValue() * 2),
----------------
fhahn wrote:

Sounds like a great idea!

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


More information about the llvm-commits mailing list