Skip to content

Commit bca4e4d

Browse files
committed
[VPlan] Improve binary matchers in two places (NFC)
1 parent ed113e7 commit bca4e4d

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
@@ -3545,8 +3545,7 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
35453545
VPValue *A, *B;
35463546
VPValue *Tmp = nullptr;
35473547
// Sub reductions could have a sub between the add reduction and vec op.
3548-
if (match(VecOp,
3549-
m_Binary<Instruction::Sub>(m_SpecificInt(0), m_VPValue(Tmp)))) {
3548+
if (match(VecOp, m_Sub(m_ZeroInt(), m_VPValue(Tmp)))) {
35503549
Sub = VecOp->getDefiningRecipe();
35513550
VecOp = Tmp;
35523551
}

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)