@@ -260,10 +260,9 @@ struct Recipe_match {
260
260
static bool matchRecipeAndOpcode (const VPRecipeBase *R) {
261
261
auto *DefR = dyn_cast<RecipeTy>(R);
262
262
// Check for recipes that do not have opcodes.
263
- if constexpr (std::is_same<RecipeTy, VPScalarIVStepsRecipe>::value ||
264
- std::is_same<RecipeTy, VPCanonicalIVPHIRecipe>::value ||
265
- std::is_same<RecipeTy, VPDerivedIVRecipe>::value ||
266
- std::is_same<RecipeTy, VPWidenGEPRecipe>::value)
263
+ if constexpr (std::is_same_v<RecipeTy, VPScalarIVStepsRecipe> ||
264
+ std::is_same_v<RecipeTy, VPCanonicalIVPHIRecipe> ||
265
+ std::is_same_v<RecipeTy, VPDerivedIVRecipe>)
267
266
return DefR;
268
267
else
269
268
return DefR && DefR->getOpcode () == Opcode;
@@ -532,15 +531,24 @@ m_SpecificCmp(CmpPredicate MatchPred, const Op0_t &Op0, const Op1_t &Op1) {
532
531
}
533
532
534
533
template <typename Op0_t, typename Op1_t>
535
- using GEPLikeRecipe_match =
534
+ using GEPLikeRecipe_match = match_combine_or<
536
535
Recipe_match<std::tuple<Op0_t, Op1_t>, Instruction::GetElementPtr,
537
- /* Commutative*/ false , VPWidenRecipe, VPReplicateRecipe,
538
- VPWidenGEPRecipe, VPInstruction>;
536
+ /* Commutative*/ false , VPReplicateRecipe, VPWidenGEPRecipe>,
537
+ match_combine_or<
538
+ VPInstruction_match<VPInstruction::PtrAdd, Op0_t, Op1_t>,
539
+ VPInstruction_match<VPInstruction::WidePtrAdd, Op0_t, Op1_t>>>;
539
540
540
541
template <typename Op0_t, typename Op1_t>
541
542
inline GEPLikeRecipe_match<Op0_t, Op1_t> m_GetElementPtr (const Op0_t &Op0,
542
543
const Op1_t &Op1) {
543
- return GEPLikeRecipe_match<Op0_t, Op1_t>(Op0, Op1);
544
+ return m_CombineOr (
545
+ Recipe_match<std::tuple<Op0_t, Op1_t>, Instruction::GetElementPtr,
546
+ /* Commutative*/ false , VPReplicateRecipe, VPWidenGEPRecipe>(
547
+ Op0, Op1),
548
+ m_CombineOr (
549
+ VPInstruction_match<VPInstruction::PtrAdd, Op0_t, Op1_t>(Op0, Op1),
550
+ VPInstruction_match<VPInstruction::WidePtrAdd, Op0_t, Op1_t>(Op0,
551
+ Op1)));
544
552
}
545
553
546
554
template <typename Op0_t, typename Op1_t, typename Op2_t>
0 commit comments