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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 09:56:13 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);
----------------
fhahn wrote:

I think this should either retain the dyn_cast or drop the check; it is current dead, as `cast` asserts the cast succeeds.

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


More information about the llvm-commits mailing list