[llvm] [LV] Simplify the chain traversal in `getScaledReductions()` (NFCI) (PR #184830)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 03:18:51 PST 2026
================
@@ -6159,33 +6131,71 @@ getScaledReductions(VPReductionPHIRecipe *RedPhiR, VPValue *PrevValue,
if (!BinOp || !Instruction::isBinaryOp(BinOp->getOpcode()) ||
!MatchExtends(BinOp->operands()))
- return false;
+ return std::nullopt;
} else if (match(UpdateR, m_Add(m_VPValue(), m_VPValue())) ||
match(UpdateR, m_FAdd(m_VPValue(), m_VPValue()))) {
- // We already know the operands for Update are Op and PhiOp.
+ // We already know Op is an operand of UpdateR.
if (!MatchExtends({Op}))
- return false;
+ return std::nullopt;
BinOp = UpdateR;
} else {
- return false;
+ return std::nullopt;
}
+ return ExtendedReductionOperand{BinOp, CastRecipes};
+}
+
+/// Examines reduction operations to see if the target can use a cheaper
----------------
fhahn wrote:
```suggestion
/// Examines reduction operations of \p RedPhiR to see if the target can use a cheaper
```
or something like that to clarify this looks for the operations that are part of the `RedPhiR` reduction cycle
https://github.com/llvm/llvm-project/pull/184830
More information about the llvm-commits
mailing list