[llvm] [LV] Removing option that is no longer needed after recent updates to loop interleaving algorithm (PR #82955)

Nilanjana Basu via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 25 19:33:41 PST 2024


https://github.com/nilanjana87 created https://github.com/llvm/llvm-project/pull/82955

Recent set of changes (Ref: https://github.com/llvm/llvm-project/pull/67725) in loop interleaving algorithm removed the loop trip count threshold for allowing interleaving. Therefore `interleave-small-loop-scalar-reduction` option is no longer useful.


>From ab694e1211f447d19ec8209232e9b17f4745b621 Mon Sep 17 00:00:00 2001
From: Nilanjana Basu <n_basu at apple.com>
Date: Sun, 25 Feb 2024 19:29:10 -0800
Subject: [PATCH] [LV] Removing option that is no longer needed after recent
 updates to loop interleaving algorithm

---
 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 373ea751d568ae..b7ae932677bbe3 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -315,12 +315,6 @@ static cl::opt<bool> EnableLoadStoreRuntimeInterleave(
     cl::desc(
         "Enable runtime interleaving until load/store ports are saturated"));
 
-/// Interleave small loops with scalar reductions.
-static cl::opt<bool> InterleaveSmallLoopScalarReduction(
-    "interleave-small-loop-scalar-reduction", cl::init(false), cl::Hidden,
-    cl::desc("Enable interleaving for loops with small iteration counts that "
-             "contain scalar reductions to expose ILP."));
-
 /// The number of stores in a loop that are allowed to need predication.
 static cl::opt<unsigned> NumberOfStoresToPredicate(
     "vectorize-num-stores-pred", cl::init(1), cl::Hidden,
@@ -5477,8 +5471,7 @@ LoopVectorizationCostModel::selectInterleaveCount(ElementCount VF,
 
     // If there are scalar reductions and TTI has enabled aggressive
     // interleaving for reductions, we will interleave to expose ILP.
-    if (InterleaveSmallLoopScalarReduction && VF.isScalar() &&
-        AggressivelyInterleaveReductions) {
+    if (VF.isScalar() && AggressivelyInterleaveReductions) {
       LLVM_DEBUG(dbgs() << "LV: Interleaving to expose ILP.\n");
       // Interleave no less than SmallIC but not as aggressive as the normal IC
       // to satisfy the rare situation when resources are too limited.



More information about the llvm-commits mailing list