[llvm] [LV] Simplify the chain traversal in `getScaledReductions()` (NFCI) (PR #184830)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 10:32:02 PDT 2026


================
@@ -6080,38 +6084,18 @@ getScaledReductions(VPReductionPHIRecipe *RedPhiR, VPValue *PrevValue,
   std::optional<TTI::PartialReductionExtendKind> OuterExtKind;
   if (match(Op, m_ZExtOrSExt(m_Mul(m_VPValue(), m_VPValue()))) ||
       match(Op, m_FPExt(m_FMul(m_VPValue(), m_VPValue())))) {
-    auto *CastRecipe = dyn_cast<VPWidenCastRecipe>(Op);
+    auto *CastRecipe = cast<VPWidenCastRecipe>(Op);
----------------
MacDue wrote:

I've put the `dyn_cast` back. I have a follow-up that cleans up `matchExtendedReductionOperand`.

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


More information about the llvm-commits mailing list