From 0ab4edd02e867c3d3ebb6cb1c687092eefc6e15d Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Tue, 9 Jun 2020 14:04:13 +0100 Subject: [PATCH] [PatternMatch] Support matching intrinsics with 6 arguments. I couldn't find a generic intrinsic with 6 arguments in tree for a unit test, but soon there will be one. --- llvm/include/llvm/IR/PatternMatch.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h index feb2da0..5f1c8b8 100644 --- a/llvm/include/llvm/IR/PatternMatch.h +++ b/llvm/include/llvm/IR/PatternMatch.h @@ -1920,6 +1920,12 @@ struct m_Intrinsic_Ty { Argument_match>; }; +template +struct m_Intrinsic_Ty { + using Ty = match_combine_and::Ty, + Argument_match>; +}; + /// Match intrinsic calls like this: /// m_Intrinsic(m_Value(X)) template inline IntrinsicID_match m_Intrinsic() { @@ -1959,6 +1965,15 @@ m_Intrinsic(const T0 &Op0, const T1 &Op1, const T2 &Op2, const T3 &Op3, m_Argument<4>(Op4)); } +template +inline typename m_Intrinsic_Ty::Ty +m_Intrinsic(const T0 &Op0, const T1 &Op1, const T2 &Op2, const T3 &Op3, + const T4 &Op4, const T5 &Op5) { + return m_CombineAnd(m_Intrinsic(Op0, Op1, Op2, Op3, Op4), + m_Argument<5>(Op5)); +} + // Helper intrinsic matching specializations. template inline typename m_Intrinsic_Ty::Ty m_BitReverse(const Opnd0 &Op0) { -- 2.7.4