@@ -1319,6 +1319,26 @@ m_AddLike(const LHS &L, const RHS &R) {
13191319 return m_CombineOr (m_Add (L, R), m_DisjointOr (L, R));
13201320}
13211321
1322+ // / Match either "add nsw" or "or disjoint"
1323+ template <typename LHS, typename RHS>
1324+ inline match_combine_or<
1325+ OverflowingBinaryOp_match<LHS, RHS, Instruction::Add,
1326+ OverflowingBinaryOperator::NoSignedWrap>,
1327+ DisjointOr_match<LHS, RHS>>
1328+ m_NSWAddLike (const LHS &L, const RHS &R) {
1329+ return m_CombineOr (m_NSWAdd (L, R), m_DisjointOr (L, R));
1330+ }
1331+
1332+ // / Match either "add nuw" or "or disjoint"
1333+ template <typename LHS, typename RHS>
1334+ inline match_combine_or<
1335+ OverflowingBinaryOp_match<LHS, RHS, Instruction::Add,
1336+ OverflowingBinaryOperator::NoUnsignedWrap>,
1337+ DisjointOr_match<LHS, RHS>>
1338+ m_NUWAddLike (const LHS &L, const RHS &R) {
1339+ return m_CombineOr (m_NUWAdd (L, R), m_DisjointOr (L, R));
1340+ }
1341+
13221342// ===----------------------------------------------------------------------===//
13231343// Class that matches a group of binary opcodes.
13241344//
0 commit comments