24 case ICmpInst::ICMP_UGT:
return 1;
25 case ICmpInst::ICMP_SGT:
return 1;
26 case ICmpInst::ICMP_EQ:
return 2;
27 case ICmpInst::ICMP_UGE:
return 3;
28 case ICmpInst::ICMP_SGE:
return 3;
29 case ICmpInst::ICMP_ULT:
return 4;
30 case ICmpInst::ICMP_SLT:
return 4;
31 case ICmpInst::ICMP_NE:
return 5;
32 case ICmpInst::ICMP_ULE:
return 6;
33 case ICmpInst::ICMP_SLE:
return 6;
46 case 1: Pred = Sign ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
break;
47 case 2: Pred = ICmpInst::ICMP_EQ;
break;
48 case 3: Pred = Sign ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE;
break;
49 case 4: Pred = Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT;
break;
50 case 5: Pred = ICmpInst::ICMP_NE;
break;
51 case 6: Pred = Sign ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_ULE;
break;
67 assert(FCmpInst::FCMP_FALSE <= Pred && Pred <= FCmpInst::FCMP_TRUE &&
68 "Unexpected FCmp predicate!");
69 if (Pred == FCmpInst::FCMP_FALSE)
71 if (Pred == FCmpInst::FCMP_TRUE)
79 using namespace PatternMatch;
88 case ICmpInst::ICMP_SLT:
93 Pred = ICmpInst::ICMP_NE;
95 case ICmpInst::ICMP_SLE:
100 Pred = ICmpInst::ICMP_NE;
102 case ICmpInst::ICMP_SGT:
107 Pred = ICmpInst::ICMP_EQ;
109 case ICmpInst::ICMP_SGE:
114 Pred = ICmpInst::ICMP_EQ;
116 case ICmpInst::ICMP_ULT:
118 if (!
C->isPowerOf2())
121 Pred = ICmpInst::ICMP_EQ;
123 case ICmpInst::ICMP_ULE:
125 if (!(*
C + 1).isPowerOf2())
128 Pred = ICmpInst::ICMP_EQ;
130 case ICmpInst::ICMP_UGT:
132 if (!(*
C + 1).isPowerOf2())
135 Pred = ICmpInst::ICMP_NE;
137 case ICmpInst::ICMP_UGE:
139 if (!
C->isPowerOf2())
142 Pred = ICmpInst::ICMP_NE;
147 Mask = Mask.zext(
X->getType()->getScalarSizeInBits());
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Class for arbitrary precision integers.
static APInt getSignMask(unsigned BitWidth)
Get the SignMask for a specific bit width.
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
This is an important base class in LLVM.
bool isEquality() const
Return true if this predicate is either EQ or NE.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
CastInst_match< OpTy, TruncInst > m_Trunc(const OpTy &Op)
Matches Trunc.
bool match(Val *V, const Pattern &P)
apint_match m_APIntAllowPoison(const APInt *&Res)
Match APInt while allowing poison in splat vector constants.
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
This is an optimization pass for GlobalISel generic memory operations.
Constant * getPredForFCmpCode(unsigned Code, Type *OpTy, CmpInst::Predicate &Pred)
This is the complement of getFCmpCode.
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 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(CmpInst::Predicate Pred)
Encode a icmp predicate into a three bit mask.
Constant * getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy, CmpInst::Predicate &Pred)
This is the complement of getICmpCode.