69 using namespace PatternMatch;
80 if (!
C->isNullValue())
87 if (!
C->isAllOnesValue())
94 if (!
C->isAllOnesValue())
101 if (!
C->isNullValue())
108 if (!
C->isPowerOf2())
115 if (!(*
C + 1).isPowerOf2())
122 if (!(*
C + 1).isPowerOf2())
129 if (!
C->isPowerOf2())
137 Mask =
Mask.zext(
X->getType()->getScalarSizeInBits());
Constant * getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy, CmpInst::Predicate &Pred)
This is the complement of getICmpCode.
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
This class represents lattice values for constants.
bool decomposeBitTestICmp(Value *LHS, Value *RHS, CmpInst::Predicate &Pred, Value *&X, APInt &Mask, bool LookThroughTrunc=true)
Decompose an icmp into the form ((X & Mask) pred 0) if possible.
unsigned getICmpCode(const ICmpInst *ICI, bool InvertPred=false)
Encode a icmp predicate into a three bit mask.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
bool match(Val *V, const Pattern &P)
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE,...
CastClass_match< OpTy, Instruction::Trunc > m_Trunc(const OpTy &Op)
Matches Trunc.
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
unsigned greater or equal
apint_match m_APInt(const APInt *&Res)
Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt.
The instances of the Type class are immutable: once they are created, they are never changed.
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This instruction compares its operands according to the predicate given to the constructor.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static APInt getSignMask(unsigned BitWidth)
Get the SignMask for a specific bit width.
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Class for arbitrary precision integers.
Predicate getPredicate() const
Return the predicate for this instruction.
bool isEquality() const
Return true if this predicate is either EQ or NE.
LLVM Value Representation.
bool predicatesFoldable(CmpInst::Predicate P1, CmpInst::Predicate P2)
Return true if both predicates match sign or if at least one of them is an equality comparison (which...