[llvm] [InstCombine] linearize complexity of findDemandedEltsByAllUsers() (PR #161436)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 14:00:10 PDT 2025


================
@@ -320,44 +320,49 @@ Instruction *InstCombinerImpl::foldBitcastExtElt(ExtractElementInst &Ext) {
 }
 
 /// Find elements of V demanded by UserInstr.
-static APInt findDemandedEltsBySingleUser(Value *V, Instruction *UserInstr) {
-  unsigned VWidth = cast<FixedVectorType>(V->getType())->getNumElements();
+static void findDemandedEltsBySingleUser(Value *V, Instruction *UserInstr,
+                                         APInt &UnionUsedElts) {
+  const unsigned VWidth = cast<FixedVectorType>(V->getType())->getNumElements();
----------------
nikic wrote:

Unrelated change here and below.

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


More information about the llvm-commits mailing list