[llvm] bb2a63a - [VPlan] Use m_Isa to improve code (NFC) (#190149)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 07:53:10 PDT 2026
Author: Ramkumar Ramachandra
Date: 2026-04-02T15:53:05+01:00
New Revision: bb2a63a673fff0ad90eda49144320d0066040e9d
URL: https://github.com/llvm/llvm-project/commit/bb2a63a673fff0ad90eda49144320d0066040e9d
DIFF: https://github.com/llvm/llvm-project/commit/bb2a63a673fff0ad90eda49144320d0066040e9d.diff
LOG: [VPlan] Use m_Isa to improve code (NFC) (#190149)
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 9944df4778774..a33743edb1332 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -3236,12 +3236,10 @@ static void fixupVFUsersForEVL(VPlan &Plan, VPValue &EVL) {
});
assert(all_of(Plan.getVFxUF().users(),
- [&LoopRegion, &Plan](VPUser *U) {
- return match(U,
- m_c_Add(m_Specific(LoopRegion->getCanonicalIV()),
- m_Specific(&Plan.getVFxUF()))) ||
- isa<VPWidenPointerInductionRecipe>(U);
- }) &&
+ match_fn(m_CombineOr(
+ m_c_Add(m_Specific(LoopRegion->getCanonicalIV()),
+ m_Specific(&Plan.getVFxUF())),
+ m_Isa<VPWidenPointerInductionRecipe>()))) &&
"Only users of VFxUF should be VPWidenPointerInductionRecipe and the "
"increment of the canonical induction.");
Plan.getVFxUF().replaceUsesWithIf(&EVL, [](VPUser &U, unsigned Idx) {
@@ -4432,9 +4430,8 @@ tryToMatchAndCreateExtendedReduction(VPReductionRecipe *Red, VPCostContext &Ctx,
VPValue *A;
// Match reduce(ext)).
- if (isa<VPWidenCastRecipe>(VecOp) &&
- (match(VecOp, m_ZExtOrSExt(m_VPValue(A))) ||
- match(VecOp, m_FPExt(m_VPValue(A)))) &&
+ if (match(VecOp, m_Isa<VPWidenCastRecipe>(m_CombineOr(
+ m_ZExtOrSExt(m_VPValue(A)), m_FPExt(m_VPValue(A))))) &&
IsExtendedRedValidAndClampRange(
RecurrenceDescriptor::getOpcode(Red->getRecurrenceKind()),
cast<VPWidenCastRecipe>(VecOp)->getOpcode(),
More information about the llvm-commits
mailing list