Skip to content

Commit b93359e

Browse files
committed
Intro m_Reverse
1 parent f61eaad commit b93359e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ m_LastActiveLane(const Op0_t &Op0) {
454454
return m_VPInstruction<VPInstruction::LastActiveLane>(Op0);
455455
}
456456

457+
template <typename Op0_t>
458+
inline VPInstruction_match<VPInstruction::Reverse, Op0_t>
459+
m_Reverse(const Op0_t &Op0) {
460+
return m_VPInstruction<VPInstruction::Reverse>(Op0);
461+
}
462+
457463
inline VPInstruction_match<VPInstruction::StepVector> m_StepVector() {
458464
return m_VPInstruction<VPInstruction::StepVector>();
459465
}

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,7 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
28912891

28922892
// TODO: Only convert reverse to vp.reverse if it uses the result of
28932893
// vp.load, or defines the stored value of vp.store.
2894-
if (match(&R, m_VPInstruction<VPInstruction::Reverse>(m_VPValue(V1)))) {
2894+
if (match(&R, m_Reverse(m_VPValue(V1)))) {
28952895
NewRecipe = new VPWidenIntrinsicRecipe(
28962896
Intrinsic::experimental_vp_reverse, {V1, Plan.getTrue(), &EVL},
28972897
TypeInfo.inferScalarType(R.getVPSingleValue()), {}, {},

0 commit comments

Comments
 (0)