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

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 02:48:10 PST 2026


================
@@ -6082,36 +6074,16 @@ getScaledReductions(VPReductionPHIRecipe *RedPhiR, VPValue *PrevValue,
       match(Op, m_FPExt(m_FMul(m_VPValue(), m_VPValue())))) {
     auto *CastRecipe = dyn_cast<VPWidenCastRecipe>(Op);
     if (!CastRecipe)
----------------
MacDue wrote:

I think it's guarding against a `VPReplicateRecipe` (which could occur for `VF=1,UC>1`), but we'd reject that earlier as the exit value would not be a `VPWidenRecipe`, so I'm not sure this is reachable. 

It may be safe to replace with a `cast<VPWidenCastRecipe>` (all tests pass), but I'll leave that to a follow up. 

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


More information about the llvm-commits mailing list