Skip to content

Commit 5cb548e

Browse files
committed
!fixup address latest comments, thanks
1 parent bb0c0ac commit 5cb548e

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,6 @@ m_c_Binary(const Op0_t &Op0, const Op1_t &Op1) {
431431
return AllRecipe_commutative_match<Opcode, Op0_t, Op1_t>(Op0, Op1);
432432
}
433433

434-
template <typename Op0_t, typename Op1_t>
435-
inline AllRecipe_match<Instruction::Add, Op0_t, Op1_t> m_Add(const Op0_t &Op0,
436-
const Op1_t &Op1) {
437-
return m_Binary<Instruction::Add, Op0_t, Op1_t>(Op0, Op1);
438-
}
439-
440434
template <typename Op0_t, typename Op1_t>
441435
inline AllRecipe_commutative_match<Instruction::Add, Op0_t, Op1_t>
442436
m_c_Add(const Op0_t &Op0, const Op1_t &Op1) {

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,8 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
12341234
if (!Plan->isUnrolled())
12351235
return;
12361236

1237-
if (match(Def, m_Add(m_VPValue(X), m_VPValue(Y))) && Y->isLiveIn() &&
1237+
// Hoist an invariant increment Y of a phi X, by having X start at Y.
1238+
if (match(Def, m_c_Add(m_VPValue(X), m_VPValue(Y))) && Y->isLiveIn() &&
12381239
isa<VPPhi>(X)) {
12391240
auto *Phi = cast<VPPhi>(X);
12401241
if (Phi->getOperand(1) != Def && match(Phi->getOperand(0), m_ZeroInt()) &&

0 commit comments

Comments
 (0)