[llvm] [VPlan] Use parameter packs to avoid unary/binary/ternary matchers. NFC (PR #152272)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 04:08:09 PDT 2025


================
@@ -270,176 +263,109 @@ struct Recipe_match {
   }
 };
 
-template <unsigned Opcode, typename... RecipeTys>
-using ZeroOpRecipe_match =
-    Recipe_match<std::tuple<>, Opcode, false, RecipeTys...>;
-
-template <typename Op0_t, unsigned Opcode, typename... RecipeTys>
-using UnaryRecipe_match =
-    Recipe_match<std::tuple<Op0_t>, Opcode, false, RecipeTys...>;
-
-template <typename Op0_t, unsigned Opcode>
-using UnaryVPInstruction_match =
-    UnaryRecipe_match<Op0_t, Opcode, VPInstruction>;
-
-template <unsigned Opcode>
-using ZeroOpVPInstruction_match = ZeroOpRecipe_match<Opcode, VPInstruction>;
-
-template <typename Op0_t, unsigned Opcode>
-using AllUnaryRecipe_match =
-    UnaryRecipe_match<Op0_t, Opcode, VPWidenRecipe, VPReplicateRecipe,
-                      VPWidenCastRecipe, VPInstruction>;
-
-template <typename Op0_t, typename Op1_t, unsigned Opcode, bool Commutative,
-          typename... RecipeTys>
-using BinaryRecipe_match =
-    Recipe_match<std::tuple<Op0_t, Op1_t>, Opcode, Commutative, RecipeTys...>;
+template <unsigned Opcode, bool Commutative = false, typename... OpTys>
----------------
artagnon wrote:

```suggestion
template <unsigned Opcode, bool Commutative, typename... OpTys>
```

Let's not have a confusing default paramter.

https://github.com/llvm/llvm-project/pull/152272


More information about the llvm-commits mailing list