[llvm] [ValueTracking] Support srem/urem for isKnownNonNullFromDominatingCondition (PR #74021)
Dhruv Chawla via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 19:26:04 PST 2023
================
@@ -2186,7 +2186,9 @@ static bool isKnownNonNullFromDominatingCondition(const Value *V,
return true;
}
- if (match(U, m_IDiv(m_Value(), m_Specific(V))) &&
+ if ((match(U, m_IDiv(m_Value(), m_Specific(V))) ||
+ match(U, m_URem(m_Value(), m_Specific(V))) ||
+ match(U, m_SRem(m_Value(), m_Specific(V)))) &&
----------------
dc03 wrote:
You can use `m_IRem` to match both `srem` and `urem` at the same time.
https://github.com/llvm/llvm-project/pull/74021
More information about the llvm-commits
mailing list