[llvm] [LV] Support multiplies by constants when forming scaled reductions. (PR #161092)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 2 04:01:47 PDT 2025


================
@@ -7954,6 +7954,13 @@ bool VPRecipeBuilder::getScaledReductions(
   auto CollectExtInfo = [this, &Exts, &ExtOpTypes,
                          &ExtKinds](SmallVectorImpl<Value *> &Ops) -> bool {
     for (const auto &[I, OpI] : enumerate(Ops)) {
+      auto *CI = dyn_cast<ConstantInt>(OpI);
+      if (I > 0 && CI &&
----------------
artagnon wrote:

Would have been good to drop_begin in the enumerate?

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


More information about the llvm-commits mailing list