Skip to content

Commit 107940f

Browse files
authored
[VPlan] Improve binary matchers in two places (NFC) (#162268)
1 parent f7f49ee commit 107940f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,8 +3544,7 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
35443544
VPValue *A, *B;
35453545
VPValue *Tmp = nullptr;
35463546
// Sub reductions could have a sub between the add reduction and vec op.
3547-
if (match(VecOp,
3548-
m_Binary<Instruction::Sub>(m_SpecificInt(0), m_VPValue(Tmp)))) {
3547+
if (match(VecOp, m_Sub(m_ZeroInt(), m_VPValue(Tmp)))) {
35493548
Sub = VecOp->getDefiningRecipe();
35503549
VecOp = Tmp;
35513550
}

llvm/lib/Transforms/Vectorize/VPlanUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ bool vputils::isHeaderMask(const VPValue *V, VPlan &Plan) {
7171
m_Specific(&Plan.getVF()))) ||
7272
IsWideCanonicalIV(A));
7373

74-
return match(V, m_Binary<Instruction::ICmp>(m_VPValue(A), m_VPValue(B))) &&
75-
IsWideCanonicalIV(A) && B == Plan.getOrCreateBackedgeTakenCount();
74+
return match(V, m_ICmp(m_VPValue(A), m_VPValue(B))) && IsWideCanonicalIV(A) &&
75+
B == Plan.getOrCreateBackedgeTakenCount();
7676
}
7777

7878
const SCEV *vputils::getSCEVExprForVPValue(VPValue *V, ScalarEvolution &SE) {

0 commit comments

Comments
 (0)