Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Analysis/InstructionSimplify.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,554 Lines • ▼ Show 20 Lines | |||||
/// Commuted variants are assumed to be handled by calling this function again | /// Commuted variants are assumed to be handled by calling this function again | ||||
/// with the parameters swapped. | /// with the parameters swapped. | ||||
static Value *simplifyUnsignedRangeCheck(ICmpInst *ZeroICmp, | static Value *simplifyUnsignedRangeCheck(ICmpInst *ZeroICmp, | ||||
ICmpInst *UnsignedICmp, bool IsAnd, | ICmpInst *UnsignedICmp, bool IsAnd, | ||||
const SimplifyQuery &Q) { | const SimplifyQuery &Q) { | ||||
Value *X, *Y; | Value *X, *Y; | ||||
ICmpInst::Predicate EqPred; | ICmpInst::Predicate EqPred; | ||||
if (!match(ZeroICmp, m_ICmp(EqPred, m_Value(Y), m_Zero())) || | if (!(match(ZeroICmp, m_ICmp(EqPred, m_Value(Y), m_Zero())) || | ||||
match(ZeroICmp, m_ICmp(EqPred, m_Zero(), m_Value(Y)))) || | |||||
nikic: You can use `m_c_ICmp`. | |||||
!ICmpInst::isEquality(EqPred)) | !ICmpInst::isEquality(EqPred)) | ||||
return nullptr; | return nullptr; | ||||
ICmpInst::Predicate UnsignedPred; | ICmpInst::Predicate UnsignedPred; | ||||
Value *A, *B; | Value *A, *B; | ||||
// Y = (A - B); | // Y = (A - B); | ||||
if (match(Y, m_Sub(m_Value(A), m_Value(B)))) { | if (match(Y, m_Sub(m_Value(A), m_Value(B)))) { | ||||
▲ Show 20 Lines • Show All 5,353 Lines • Show Last 20 Lines |
You can use m_c_ICmp.