@@ -195,7 +195,7 @@ inline bind_ty<VPValue> m_VPValue(VPValue *&V) { return V; }
195195// / Match a VPInstruction, capturing if we match.
196196inline bind_ty<VPInstruction> m_VPInstruction (VPInstruction *&V) { return V; }
197197
198- template <typename Ops_t, unsigned Opcode, bool Commutative, bool Variadic,
198+ template <typename Ops_t, unsigned Opcode, bool Commutative,
199199 typename ... RecipeTys>
200200struct Recipe_match {
201201 Ops_t Ops;
@@ -232,9 +232,9 @@ struct Recipe_match {
232232 return false ;
233233
234234 if (R->getNumOperands () != std::tuple_size<Ops_t>::value) {
235- assert (Variadic && " non-variadic recipe with matched opcode does not "
236- " have the expected number of "
237- " operands" );
235+ assert (Opcode == Instruction::PHI &&
236+ " non-variadic recipe with matched opcode does not have the "
237+ " expected number of operands" );
238238 return false ;
239239 }
240240
@@ -259,9 +259,7 @@ struct Recipe_match {
259259 std::is_same<RecipeTy, VPCanonicalIVPHIRecipe>::value ||
260260 std::is_same<RecipeTy, VPWidenSelectRecipe>::value ||
261261 std::is_same<RecipeTy, VPDerivedIVRecipe>::value ||
262- std::is_same<RecipeTy, VPWidenGEPRecipe>::value ||
263- std::is_same<RecipeTy, VPWidenPHIRecipe>::value ||
264- std::is_same<RecipeTy, VPHeaderPHIRecipe>::value)
262+ std::is_same<RecipeTy, VPWidenGEPRecipe>::value)
265263 return DefR;
266264 else
267265 return DefR && DefR->getOpcode () == Opcode;
@@ -277,11 +275,11 @@ struct Recipe_match {
277275
278276template <unsigned Opcode, typename ... RecipeTys>
279277using ZeroOpRecipe_match =
280- Recipe_match<std::tuple<>, Opcode, false , false , RecipeTys...>;
278+ Recipe_match<std::tuple<>, Opcode, false , RecipeTys...>;
281279
282280template <typename Op0_t, unsigned Opcode, typename ... RecipeTys>
283281using UnaryRecipe_match =
284- Recipe_match<std::tuple<Op0_t>, Opcode, false , false , RecipeTys...>;
282+ Recipe_match<std::tuple<Op0_t>, Opcode, false , RecipeTys...>;
285283
286284template <typename Op0_t, unsigned Opcode>
287285using UnaryVPInstruction_match =
@@ -298,8 +296,7 @@ using AllUnaryRecipe_match =
298296template <typename Op0_t, typename Op1_t, unsigned Opcode, bool Commutative,
299297 typename ... RecipeTys>
300298using BinaryRecipe_match =
301- Recipe_match<std::tuple<Op0_t, Op1_t>, Opcode, Commutative,
302- /* Variadic*/ false , RecipeTys...>;
299+ Recipe_match<std::tuple<Op0_t, Op1_t>, Opcode, Commutative, RecipeTys...>;
303300
304301template <typename Op0_t, typename Op1_t, unsigned Opcode>
305302using BinaryVPInstruction_match =
@@ -308,9 +305,8 @@ using BinaryVPInstruction_match =
308305
309306template <typename Op0_t, typename Op1_t, typename Op2_t, unsigned Opcode,
310307 bool Commutative, typename ... RecipeTys>
311- using TernaryRecipe_match =
312- Recipe_match<std::tuple<Op0_t, Op1_t, Op2_t>, Opcode, Commutative,
313- /* Variadic*/ false , RecipeTys...>;
308+ using TernaryRecipe_match = Recipe_match<std::tuple<Op0_t, Op1_t, Op2_t>,
309+ Opcode, Commutative, RecipeTys...>;
314310
315311template <typename Op0_t, typename Op1_t, typename Op2_t, unsigned Opcode>
316312using TernaryVPInstruction_match =
@@ -350,9 +346,8 @@ m_VPInstruction(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2) {
350346
351347template <typename Op0_t, typename Op1_t, typename Op2_t, typename Op3_t,
352348 unsigned Opcode, bool Commutative, typename ... RecipeTys>
353- using Recipe4Op_match =
354- Recipe_match<std::tuple<Op0_t, Op1_t, Op2_t, Op3_t>, Opcode, Commutative,
355- /* Variadic*/ false , RecipeTys...>;
349+ using Recipe4Op_match = Recipe_match<std::tuple<Op0_t, Op1_t, Op2_t, Op3_t>,
350+ Opcode, Commutative, RecipeTys...>;
356351
357352template <typename Op0_t, typename Op1_t, typename Op2_t, typename Op3_t,
358353 unsigned Opcode>
@@ -386,12 +381,6 @@ m_Broadcast(const Op0_t &Op0) {
386381 return m_VPInstruction<VPInstruction::Broadcast>(Op0);
387382}
388383
389- template <typename Op0_t>
390- inline UnaryVPInstruction_match<Op0_t, VPInstruction::ExplicitVectorLength>
391- m_ExplicitVectorLength (const Op0_t &Op0) {
392- return m_VPInstruction<VPInstruction::ExplicitVectorLength>(Op0);
393- }
394-
395384template <typename Op0_t, typename Op1_t>
396385inline BinaryVPInstruction_match<Op0_t, Op1_t, VPInstruction::ActiveLaneMask>
397386m_ActiveLaneMask (const Op0_t &Op0, const Op1_t &Op1) {
@@ -451,12 +440,6 @@ m_c_Binary(const Op0_t &Op0, const Op1_t &Op1) {
451440 return AllBinaryRecipe_match<Op0_t, Op1_t, Opcode, true >(Op0, Op1);
452441}
453442
454- template <typename Op0_t, typename Op1_t>
455- inline AllBinaryRecipe_match<Op0_t, Op1_t, Instruction::Sub>
456- m_Sub (const Op0_t &Op0, const Op1_t &Op1) {
457- return m_Binary<Instruction::Sub, Op0_t, Op1_t>(Op0, Op1);
458- }
459-
460443template <typename Op0_t, typename Op1_t>
461444inline AllBinaryRecipe_match<Op0_t, Op1_t, Instruction::Mul>
462445m_Mul (const Op0_t &Op0, const Op1_t &Op1) {
@@ -502,8 +485,7 @@ inline GEPLikeRecipe_match<Op0_t, Op1_t> m_GetElementPtr(const Op0_t &Op0,
502485template <typename Op0_t, typename Op1_t, typename Op2_t, unsigned Opcode>
503486using AllTernaryRecipe_match =
504487 Recipe_match<std::tuple<Op0_t, Op1_t, Op2_t>, Opcode, false ,
505- /* Variadic*/ false , VPReplicateRecipe, VPInstruction,
506- VPWidenSelectRecipe>;
488+ VPReplicateRecipe, VPInstruction, VPWidenSelectRecipe>;
507489
508490template <typename Op0_t, typename Op1_t, typename Op2_t>
509491inline AllTernaryRecipe_match<Op0_t, Op1_t, Op2_t, Instruction::Select>
@@ -551,26 +533,14 @@ m_ScalarIVSteps(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2) {
551533
552534template <typename Op0_t, typename Op1_t, typename Op2_t>
553535using VPDerivedIV_match =
554- Recipe_match<std::tuple<Op0_t, Op1_t, Op2_t>, 0 , false , /* Variadic*/ false ,
555- VPDerivedIVRecipe>;
536+ Recipe_match<std::tuple<Op0_t, Op1_t, Op2_t>, 0 , false , VPDerivedIVRecipe>;
556537
557538template <typename Op0_t, typename Op1_t, typename Op2_t>
558539inline VPDerivedIV_match<Op0_t, Op1_t, Op2_t>
559540m_DerivedIV (const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2) {
560541 return VPDerivedIV_match<Op0_t, Op1_t, Op2_t>({Op0, Op1, Op2});
561542}
562543
563- template <typename ... OpTys>
564- using PhiLikeRecipe_match =
565- Recipe_match<std::tuple<OpTys...>, Instruction::PHI, false , true ,
566- VPWidenPHIRecipe, VPHeaderPHIRecipe, VPInstruction>;
567-
568- template <typename Op0_t, typename Op1_t, typename ... OpTys>
569- inline PhiLikeRecipe_match<Op0_t, Op1_t, OpTys...>
570- m_Phi (const Op0_t &Op0, const Op1_t &Op1, const OpTys &...Ops) {
571- return PhiLikeRecipe_match<Op0_t, Op1_t, OpTys...>(Op0, Op1, Ops...);
572- }
573-
574544// / Match a call argument at a given argument index.
575545template <typename Opnd_t> struct Argument_match {
576546 // / Call argument index to match.
0 commit comments