[llvm] [VPlan] Introduce m_Cmp; match more compares (PR #154771)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 21 08:34:27 PDT 2025
================
@@ -395,24 +395,29 @@ m_c_BinaryOr(const Op0_t &Op0, const Op1_t &Op1) {
return m_c_Binary<Instruction::Or, Op0_t, Op1_t>(Op0, Op1);
}
-/// ICmp_match is a variant of BinaryRecipe_match that also binds the comparison
-/// predicate.
-template <typename Op0_t, typename Op1_t> struct ICmp_match {
+/// Cmp_match is a variant of BinaryRecipe_match that also binds the comparison
+/// predicate. Opcodes must be within Instruction::ICmp or Instruction::FCmp.
+template <typename Op0_t, typename Op1_t, unsigned... Opcodes>
+struct Cmp_match {
+ static_assert(sizeof...(Opcodes) == 1 || sizeof...(Opcodes) == 2);
+ static_assert(
+ ((Opcodes == Instruction::ICmp || Opcodes == Instruction::FCmp) && ...));
----------------
fhahn wrote:
could you add messages here?
https://github.com/llvm/llvm-project/pull/154771
More information about the llvm-commits
mailing list