[llvm] [LV] Handle partial reductions with predication (PR #194859)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 09:33:32 PDT 2026


================
@@ -6776,7 +6837,12 @@ getScaledReductions(VPReductionPHIRecipe *RedPhiR, VPCostContext &CostCtx,
   if (!RdxResult)
     return std::nullopt;
   VPValue *ExitValue = RdxResult->getOperand(0);
-  match(ExitValue, m_Select(m_VPValue(), m_VPValue(ExitValue), m_VPValue()));
+  VPValue *SelectedValue = nullptr;
+  if (match(ExitValue, m_SelectLike(m_VPValue(), m_VPValue(SelectedValue),
+                                    m_Specific(RedPhiR))) ||
+      match(ExitValue, m_SelectLike(m_VPValue(), m_Specific(RedPhiR),
+                                    m_VPValue(SelectedValue))))
+    ExitValue = SelectedValue;
----------------
MacDue wrote:

I don't think this change is required anymore. 

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


More information about the llvm-commits mailing list