[llvm] [SLP] Increase UsesLimit to 64 (PR #99467)

Yangyu Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 03:26:52 PDT 2024


https://github.com/cyyself created https://github.com/llvm/llvm-project/pull/99467

Since commit 82b800ecb35fb46881aa52000fa40b1b99aa654e addressed the issue #99327 , we see some performance regression (13%) on some verilator generated C++ code. This is because the UsesLimit is set to 8, which is too small for the verilator generated code. I have analyzed the need for the UsesLimit from [1] and found that the UsesLimit should be at least 64 to cover most of these cases. Thus, This patch increases the UsesLimit to 64.

Link: https://github.com/llvm/llvm-project/issues/99327#issuecomment-2236052879 [1]

>From 40529f8114e2139748ce075539573e36c2bb281b Mon Sep 17 00:00:00 2001
From: Yangyu Chen <cyy at cyyself.name>
Date: Thu, 18 Jul 2024 18:19:29 +0800
Subject: [PATCH] [SLP] Increase UsesLimit to 64

Since commit 82b800ecb35fb46881aa52000fa40b1b99aa654e addressed the
issue #99327 , we see some performance regression (13%) on some
verilator generated C++ code. This is because the UsesLimit is set to
8, which is too small for the verilator generated code. I have analyzed
the need for the UsesLimit from [1] and found that the UsesLimit should
be at least 64 to cover most of these cases. Thus, This patch increases
the UsesLimit to 64.

Link: https://github.com/llvm/llvm-project/issues/99327#issuecomment-2236052879 [1]

Signed-off-by: Yangyu Chen <cyy at cyyself.name>
---
 llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index d88c6307b994b..6f0878d5384be 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -209,7 +209,7 @@ static const unsigned AliasedCheckLimit = 10;
 
 // Limit of the number of uses for potentially transformed instructions/values,
 // used in checks to avoid compile-time explode.
-static constexpr int UsesLimit = 8;
+static constexpr int UsesLimit = 64;
 
 // Another limit for the alias checks: The maximum distance between load/store
 // instructions where alias checks are done.



More information about the llvm-commits mailing list