forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
3631239b26
commit
0ab4edd02e
|
@ -1920,6 +1920,12 @@ struct m_Intrinsic_Ty<T0, T1, T2, T3, T4> {
|
|||
Argument_match<T4>>;
|
||||
};
|
||||
|
||||
template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
struct m_Intrinsic_Ty<T0, T1, T2, T3, T4, T5> {
|
||||
using Ty = match_combine_and<typename m_Intrinsic_Ty<T0, T1, T2, T3, T4>::Ty,
|
||||
Argument_match<T5>>;
|
||||
};
|
||||
|
||||
/// Match intrinsic calls like this:
|
||||
/// m_Intrinsic<Intrinsic::fabs>(m_Value(X))
|
||||
template <Intrinsic::ID IntrID> 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 <Intrinsic::ID IntrID, typename T0, typename T1, typename T2,
|
||||
typename T3, typename T4, typename T5>
|
||||
inline typename m_Intrinsic_Ty<T0, T1, T2, T3, T4, T5>::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<IntrID>(Op0, Op1, Op2, Op3, Op4),
|
||||
m_Argument<5>(Op5));
|
||||
}
|
||||
|
||||
// Helper intrinsic matching specializations.
|
||||
template <typename Opnd0>
|
||||
inline typename m_Intrinsic_Ty<Opnd0>::Ty m_BitReverse(const Opnd0 &Op0) {
|
||||
|
|
Loading…
Reference in New Issue