Go to the documentation of this file.
68 "Unexpected FCmp predicate!");
79 using namespace PatternMatch;
118 if (!
C->isPowerOf2())
125 if (!(*
C + 1).isPowerOf2())
132 if (!(*
C + 1).isPowerOf2())
139 if (!
C->isPowerOf2())
147 Mask =
Mask.zext(
X->getType()->getScalarSizeInBits());
This is an optimization pass for GlobalISel generic memory operations.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
@ ICMP_SGT
signed greater than
The instances of the Type class are immutable: once they are created, they are never changed.
bool isEquality() const
Return true if this predicate is either EQ or NE.
@ ICMP_SLE
signed less or equal
constexpr 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.
apint_match m_APInt(const APInt *&Res)
Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt.
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...
bool match(Val *V, const Pattern &P)
This might compile to this xmm1 xorps xmm0 movss xmm0 ret Now consider if the code caused xmm1 to get spilled This might produce this xmm1 movaps xmm0 movaps xmm1 movss xmm0 ret since the reload is only used by these we could fold it into the producing something like xmm1 movaps xmm0 ret saving two instructions The basic idea is that a reload from a spill if only one byte chunk is bring in zeros the one element instead of elements This can be used to simplify a variety of shuffle where the elements are fixed zeros This code generates ugly probably due to costs being off or< 4 x float > * P2
(vector float) vec_cmpeq(*A, *B) C
@ ICMP_ULE
unsigned less or equal
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.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
@ FCMP_FALSE
0 0 0 0 Always false (always folded)
This is an important base class in LLVM.
Constant * getPredForFCmpCode(unsigned Code, Type *OpTy, CmpInst::Predicate &Pred)
This is the complement of getFCmpCode.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
@ ICMP_UGE
unsigned greater or equal
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
Class for arbitrary precision integers.
@ ICMP_SLT
signed less than
@ ICMP_ULT
unsigned less than
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned getICmpCode(CmpInst::Predicate Pred)
Encode a icmp predicate into a three bit mask.
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.
Constant * getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy, CmpInst::Predicate &Pred)
This is the complement of getICmpCode.
@ ICMP_SGE
signed greater or equal
static APInt getSignMask(unsigned BitWidth)
Get the SignMask for a specific bit width.
@ ICMP_UGT
unsigned greater than
CastClass_match< OpTy, Instruction::Trunc > m_Trunc(const OpTy &Op)
Matches Trunc.
@ FCMP_TRUE
1 1 1 1 Always true (always folded)
LLVM Value Representation.