[llvm] 10f35a0 - [InstCombine] add control for SimplifyDemandedVectorElts depth limit (#113717)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 9 01:54:42 PST 2024
Author: Princeton Ferro
Date: 2024-11-09T10:54:39+01:00
New Revision: 10f35a04c94e96c1cc0497f2b3b2ab8536a98059
URL: https://github.com/llvm/llvm-project/commit/10f35a04c94e96c1cc0497f2b3b2ab8536a98059
DIFF: https://github.com/llvm/llvm-project/commit/10f35a04c94e96c1cc0497f2b3b2ab8536a98059.diff
LOG: [InstCombine] add control for SimplifyDemandedVectorElts depth limit (#113717)
Allows customizing the depth of the recursive search on vectors that
InstCombine does when looking for unused elements.
We find it helpful to be able to customize this for compile time
reasons.
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 8ca705ae1d364d..5eb807dcb76cef 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -30,6 +30,12 @@ static cl::opt<bool>
"SimplifyDemandedBits() are consistent"),
cl::Hidden, cl::init(false));
+static cl::opt<unsigned> SimplifyDemandedVectorEltsDepthLimit(
+ "instcombine-simplify-vector-elts-depth",
+ cl::desc(
+ "Depth limit when simplifying vector instructions and their operands"),
+ cl::Hidden, cl::init(10));
+
/// Check to see if the specified operand of the specified instruction is a
/// constant integer. If so, check to see if there are any bits set in the
/// constant that are not demanded. If so, shrink the constant and return true.
@@ -1432,7 +1438,7 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V,
}
// Limit search depth.
- if (Depth == 10)
+ if (Depth == SimplifyDemandedVectorEltsDepthLimit)
return nullptr;
if (!AllowMultipleUsers) {
More information about the llvm-commits
mailing list