@@ -252,10 +252,10 @@ struct Recipe_match {
252
252
static bool matchRecipeAndOpcode (const VPRecipeBase *R) {
253
253
auto *DefR = dyn_cast<RecipeTy>(R);
254
254
// Check for recipes that do not have opcodes.
255
- if constexpr (std::is_same <RecipeTy, VPScalarIVStepsRecipe>::value ||
256
- std::is_same <RecipeTy, VPCanonicalIVPHIRecipe>::value ||
257
- std::is_same <RecipeTy, VPDerivedIVRecipe>::value ||
258
- std::is_same <RecipeTy, VPWidenGEPRecipe>::value )
255
+ if constexpr (std::is_same_v <RecipeTy, VPScalarIVStepsRecipe> ||
256
+ std::is_same_v <RecipeTy, VPCanonicalIVPHIRecipe> ||
257
+ std::is_same_v <RecipeTy, VPDerivedIVRecipe> ||
258
+ std::is_same_v <RecipeTy, VPVectorPointerRecipe> )
259
259
return DefR;
260
260
else
261
261
return DefR && DefR->getOpcode () == Opcode;
@@ -524,15 +524,25 @@ m_SpecificCmp(CmpPredicate MatchPred, const Op0_t &Op0, const Op1_t &Op1) {
524
524
}
525
525
526
526
template <typename Op0_t, typename Op1_t>
527
- using GEPLikeRecipe_match =
527
+ using GEPLikeRecipe_match = match_combine_or<
528
528
Recipe_match<std::tuple<Op0_t, Op1_t>, Instruction::GetElementPtr,
529
- /* Commutative*/ false , VPWidenRecipe, VPReplicateRecipe,
530
- VPWidenGEPRecipe, VPInstruction>;
529
+ /* Commutative*/ false , VPReplicateRecipe, VPWidenGEPRecipe,
530
+ VPVectorPointerRecipe>,
531
+ match_combine_or<
532
+ VPInstruction_match<VPInstruction::PtrAdd, Op0_t, Op1_t>,
533
+ VPInstruction_match<VPInstruction::WidePtrAdd, Op0_t, Op1_t>>>;
531
534
532
535
template <typename Op0_t, typename Op1_t>
533
536
inline GEPLikeRecipe_match<Op0_t, Op1_t> m_GetElementPtr (const Op0_t &Op0,
534
537
const Op1_t &Op1) {
535
- return GEPLikeRecipe_match<Op0_t, Op1_t>(Op0, Op1);
538
+ return m_CombineOr (
539
+ Recipe_match<std::tuple<Op0_t, Op1_t>, Instruction::GetElementPtr,
540
+ /* Commutative*/ false , VPReplicateRecipe, VPWidenGEPRecipe,
541
+ VPVectorPointerRecipe>(Op0, Op1),
542
+ m_CombineOr (
543
+ VPInstruction_match<VPInstruction::PtrAdd, Op0_t, Op1_t>(Op0, Op1),
544
+ VPInstruction_match<VPInstruction::WidePtrAdd, Op0_t, Op1_t>(Op0,
545
+ Op1)));
536
546
}
537
547
538
548
template <typename Op0_t, typename Op1_t, typename Op2_t>
0 commit comments