Skip to content

Commit 1897775

Browse files
committed
[DAG]: Created method m_SelectLike to match ISD::Select and
`ISD::VSelect`
1 parent b4b7aae commit 1897775

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/include/llvm/CodeGen/SDPatternMatch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,12 @@ m_VSelect(const T0_P &Cond, const T1_P &T, const T2_P &F) {
558558
return TernaryOpc_match<T0_P, T1_P, T2_P>(ISD::VSELECT, Cond, T, F);
559559
}
560560

561+
template <typename T0_P, typename T1_P, typename T2_P>
562+
inline TernaryOpc_match<T0_P, T1_P, T2_P>
563+
m_SelectLike(const T0_P &Cond, const T1_P &T, const T2_P &F) {
564+
return m_Select(Cond, T, F) || m_VSelect(Cond, T, F);
565+
}
566+
561567
template <typename T0_P, typename T1_P, typename T2_P>
562568
inline Result_match<0, TernaryOpc_match<T0_P, T1_P, T2_P>>
563569
m_Load(const T0_P &Ch, const T1_P &Ptr, const T2_P &Offset) {

0 commit comments

Comments
 (0)