52 "disable-i2p-p2i-opt",
cl::init(
false),
53 cl::desc(
"Disables inttoptr/ptrtoint roundtrip optimization"));
59 std::optional<TypeSize>
66 assert(!Size.isScalable() &&
"Array elements cannot have a scalable size");
67 Size *=
C->getZExtValue();
72 std::optional<TypeSize>
88 return "both values to select must have same type";
91 return "select values cannot have token type";
96 return "vector select condition element type must be i1";
99 return "selected values for vector select must be vectors";
101 return "vector select requires selected vectors to have "
102 "the same vector length as select condition";
104 return "select condition must be i1 or <n x i1>";
113 PHINode::PHINode(
const PHINode &PN)
115 ReservedSpace(PN.getNumOperands()) {
136 Op<-1>().
set(
nullptr);
152 void PHINode::growOperands() {
154 unsigned NumOps =
e +
e / 2;
155 if (NumOps < 2) NumOps = 2;
157 ReservedSpace = NumOps;
168 if (ConstantValue !=
this)
173 if (ConstantValue ==
this)
175 return ConstantValue;
184 Value *ConstantValue =
nullptr;
187 if (Incoming !=
this && !isa<UndefValue>(Incoming)) {
188 if (ConstantValue && ConstantValue != Incoming)
190 ConstantValue = Incoming;
200 LandingPadInst::LandingPadInst(
Type *RetTy,
unsigned NumReservedValues,
203 init(NumReservedValues, NameStr);
206 LandingPadInst::LandingPadInst(
Type *RetTy,
unsigned NumReservedValues,
209 init(NumReservedValues, NameStr);
214 LP.getNumOperands()),
215 ReservedSpace(LP.getNumOperands()) {
219 for (
unsigned I = 0,
E = ReservedSpace;
I !=
E; ++
I)
226 const Twine &NameStr,
228 return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertBefore);
232 const Twine &NameStr,
234 return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertAtEnd);
237 void LandingPadInst::init(
unsigned NumReservedValues,
const Twine &NameStr) {
238 ReservedSpace = NumReservedValues;
247 void LandingPadInst::growOperands(
unsigned Size) {
249 if (ReservedSpace >=
e + Size)
return;
250 ReservedSpace = (
std::max(
e, 1U) + Size / 2) * 2;
257 assert(OpNo < ReservedSpace &&
"Growing didn't work!");
271 case Instruction::Invoke:
273 case Instruction::CallBr:
285 if (ChildOB.getTagName() != OpB.
getTag())
297 return cast<CallBrInst>(
this)->getNumIndirectDests() + 1;
302 if (isa<Function>(V) || isa<Constant>(V))
310 if (
auto *CI = dyn_cast<CallInst>(
this))
311 return CI->isMustTailCall();
317 if (
auto *CI = dyn_cast<CallInst>(
this))
318 return CI->isTailCall();
324 return F->getIntrinsicID();
345 if (
F->getAttributes().hasAttrSomewhere(Kind, &
Index))
362 if (!
F->getAttributes().hasParamAttr(ArgNo, Kind))
367 case Attribute::ReadNone:
369 case Attribute::ReadOnly:
371 case Attribute::WriteOnly:
380 if (
auto *CE = dyn_cast<ConstantExpr>(V))
381 if (CE->getOpcode() == BitCast)
382 V = CE->getOperand(0);
384 if (
auto *
F = dyn_cast<Function>(V))
385 return F->getAttributes().hasFnAttr(Kind);
390 bool CallBase::hasFnAttrOnCalledFunction(
StringRef Kind)
const {
392 if (
auto *CE = dyn_cast<ConstantExpr>(V))
393 if (CE->getOpcode() == BitCast)
394 V = CE->getOperand(0);
396 if (
auto *
F = dyn_cast<Function>(V))
397 return F->getAttributes().hasFnAttr(Kind);
402 template <
typename AK>
403 Attribute CallBase::getFnAttrOnCalledFunction(AK Kind)
const {
404 if constexpr (std::is_same_v<AK, Attribute::AttrKind>) {
407 assert(Kind != Attribute::Memory &&
"Use getMemoryEffects() instead");
411 if (
auto *CE = dyn_cast<ConstantExpr>(V))
412 if (
CE->getOpcode() == BitCast)
413 V =
CE->getOperand(0);
415 if (
auto *
F = dyn_cast<Function>(V))
416 return F->getAttributes().getFnAttr(Kind);
433 const unsigned BeginIndex) {
435 for (
auto &
B : Bundles)
436 It =
std::copy(
B.input_begin(),
B.input_end(), It);
439 auto BI = Bundles.begin();
440 unsigned CurrentIndex = BeginIndex;
443 assert(BI != Bundles.end() &&
"Incorrect allocation?");
445 BOI.Tag = ContextImpl->getOrInsertBundleTag(BI->getTag());
446 BOI.Begin = CurrentIndex;
447 BOI.End = CurrentIndex + BI->input_size();
448 CurrentIndex = BOI.End;
452 assert(BI == Bundles.end() &&
"Incorrect allocation?");
463 if (BOI.Begin <= OpIdx && OpIdx < BOI.End)
469 assert(OpIdx >=
arg_size() &&
"the Idx is not in the operand bundles");
472 "The Idx isn't in the operand bundle");
476 constexpr
unsigned NumberScaling = 1024;
482 while (Begin != End) {
483 unsigned ScaledOperandPerBundle =
484 NumberScaling * (std::prev(End)->End - Begin->
Begin) / (End - Begin);
485 Current = Begin + (((OpIdx - Begin->
Begin) * NumberScaling) /
486 ScaledOperandPerBundle);
488 Current = std::prev(End);
489 assert(Current < End && Current >= Begin &&
490 "the operand bundle doesn't cover every value in the range");
491 if (OpIdx >= Current->
Begin && OpIdx < Current->End)
493 if (OpIdx >= Current->
End)
499 assert(OpIdx >= Current->
Begin && OpIdx < Current->End &&
500 "the operand bundle doesn't cover every value in the range");
512 Bundles.push_back(
OB);
513 return Create(CB, Bundles, InsertPt);
519 bool CreateNew =
false;
523 if (Bundle.getTagID() ==
ID) {
530 return CreateNew ?
Create(CB, Bundles, InsertPt) : CB;
628 "NumOperands not set up?");
633 "Calling a function with bad signature!");
635 for (
unsigned i = 0;
i !=
Args.size(); ++
i)
638 "Calling a function with a bad signature!");
667 init(Ty, Func, Name);
674 init(Ty, Func, Name);
677 CallInst::CallInst(
const CallInst &CI)
680 CI.getNumOperands()) {
708 auto *ProfileData =
getMetadata(LLVMContext::MD_prof);
709 if (ProfileData ==
nullptr)
712 auto *ProfDataName = dyn_cast<MDString>(ProfileData->getOperand(0));
713 if (!ProfDataName || (!ProfDataName->getString().equals(
"branch_weights") &&
714 !ProfDataName->getString().equals(
"VP")))
718 LLVM_DEBUG(
dbgs() <<
"Attempting to update profile weights will result in "
719 "div by 0. Ignoring. Likely the function "
721 <<
" has 0 entry count, and contains call instructions "
722 "with non-zero prof info.");
728 Vals.push_back(ProfileData->getOperand(0));
729 APInt APS(128,
S), APT(128,
T);
730 if (ProfDataName->getString().equals(
"branch_weights") &&
731 ProfileData->getNumOperands() > 0) {
733 APInt Val(128, mdconst::dyn_extract<ConstantInt>(ProfileData->getOperand(1))
740 }
else if (ProfDataName->getString().equals(
"VP"))
741 for (
unsigned i = 1;
i < ProfileData->getNumOperands();
i += 2) {
743 Vals.push_back(ProfileData->getOperand(
i));
745 mdconst::dyn_extract<ConstantInt>(ProfileData->getOperand(
i + 1))
750 Vals.push_back(ProfileData->getOperand(
i + 1));
754 APInt Val(128, Count);
765 assert(
val &&
"IsConstantOne does not work with nullptr val");
767 return CVal && CVal->
isOne();
776 assert(((!InsertBefore && InsertAtEnd) || (InsertBefore && !InsertAtEnd)) &&
777 "createMalloc needs either InsertBefore or InsertAtEnd");
785 else if (ArraySize->
getType() != IntPtrTy) {
796 AllocSize = ArraySize;
797 }
else if (
Constant *CO = dyn_cast<Constant>(ArraySize)) {
806 "mallocsize", InsertBefore);
809 "mallocsize", InsertAtEnd);
813 assert(AllocSize->
getType() == IntPtrTy &&
"malloc arg is wrong size");
816 Module *
M =
BB->getParent()->getParent();
821 MallocFunc =
M->getOrInsertFunction(
"malloc", BPTy, IntPtrTy);
829 if (Result->getType() != AllocPtrType)
831 Result =
new BitCastInst(MCall, AllocPtrType, Name, InsertBefore);
835 if (Result->getType() != AllocPtrType) {
838 Result =
new BitCastInst(MCall, AllocPtrType, Name);
844 if (!
F->returnDoesNotAlias())
845 F->setReturnDoesNotAlias();
863 return createMalloc(InsertBefore,
nullptr, IntPtrTy, AllocTy, AllocSize,
864 ArraySize, std::nullopt, MallocF, Name);
872 return createMalloc(InsertBefore,
nullptr, IntPtrTy, AllocTy, AllocSize,
873 ArraySize, OpB, MallocF, Name);
888 return createMalloc(
nullptr, InsertAtEnd, IntPtrTy, AllocTy, AllocSize,
889 ArraySize, std::nullopt, MallocF, Name);
896 return createMalloc(
nullptr, InsertAtEnd, IntPtrTy, AllocTy, AllocSize,
897 ArraySize, OpB, MallocF, Name);
904 assert(((!InsertBefore && InsertAtEnd) || (InsertBefore && !InsertAtEnd)) &&
905 "createFree needs either InsertBefore or InsertAtEnd");
907 "Can not free something of nonpointer type!");
910 Module *
M =
BB->getParent()->getParent();
915 FunctionCallee FreeFunc =
M->getOrInsertFunction(
"free", VoidTy, IntPtrTy);
919 if (
Source->getType() != IntPtrTy)
923 if (
Source->getType() != IntPtrTy)
927 Result->setTailCall();
929 Result->setCallingConv(
F->getCallingConv());
950 assert(FreeCall &&
"CreateFree did not create a CallInst");
957 assert(FreeCall &&
"CreateFree did not create a CallInst");
968 const Twine &NameStr) {
973 "NumOperands not set up?");
978 "Invoking a function with bad signature");
980 for (
unsigned i = 0,
e =
Args.size();
i !=
e;
i++)
983 "Invoking a function with a bad signature!");
1003 II.getNumOperands()) {
1026 return cast<LandingPadInst>(
getUnwindDest()->getFirstNonPHI());
1037 const Twine &NameStr) {
1041 ComputeNumOperands(
Args.size(), IndirectDests.
size(),
1043 "NumOperands not set up?");
1048 "Calling a function with bad signature");
1050 for (
unsigned i = 0,
e =
Args.size();
i !=
e;
i++)
1053 "Calling a function with a bad signature!");
1059 NumIndirectDests = IndirectDests.
size();
1061 for (
unsigned i = 0;
i != NumIndirectDests; ++
i)
1072 CallBrInst::CallBrInst(
const CallBrInst &CBI)
1075 CBI.getNumOperands()) {
1081 NumIndirectDests = CBI.NumIndirectDests;
1095 NewCBI->NumIndirectDests = CBI->NumIndirectDests;
1106 RI.getNumOperands()) {
1108 Op<0>() = RI.
Op<0>();
1139 Op<0>() = RI.
Op<0>();
1161 CRI.getNumOperands(),
1162 CRI.getNumOperands()) {
1163 setSubclassData<Instruction::OpaqueField>(
1165 Op<0>() = CRI.
Op<0>();
1167 Op<1>() = CRI.
Op<1>();
1170 void CleanupReturnInst::init(
Value *CleanupPad,
BasicBlock *UnwindBB) {
1172 setSubclassData<UnwindDestField>(
true);
1174 Op<0>() = CleanupPad;
1179 CleanupReturnInst::CleanupReturnInst(
Value *CleanupPad,
BasicBlock *UnwindBB,
1184 Values, InsertBefore) {
1185 init(CleanupPad, UnwindBB);
1188 CleanupReturnInst::CleanupReturnInst(
Value *CleanupPad,
BasicBlock *UnwindBB,
1193 Values, InsertAtEnd) {
1194 init(CleanupPad, UnwindBB);
1208 Op<0>() = CRI.
Op<0>();
1209 Op<1>() = CRI.
Op<1>();
1232 CatchSwitchInst::CatchSwitchInst(
Value *ParentPad,
BasicBlock *UnwindDest,
1233 unsigned NumReservedValues,
1234 const Twine &NameStr,
1239 ++NumReservedValues;
1240 init(ParentPad, UnwindDest, NumReservedValues + 1);
1244 CatchSwitchInst::CatchSwitchInst(
Value *ParentPad,
BasicBlock *UnwindDest,
1245 unsigned NumReservedValues,
1250 ++NumReservedValues;
1251 init(ParentPad, UnwindDest, NumReservedValues + 1);
1257 CSI.getNumOperands()) {
1262 for (
unsigned I = 1,
E = ReservedSpace;
I !=
E; ++
I)
1267 unsigned NumReservedValues) {
1268 assert(ParentPad && NumReservedValues);
1270 ReservedSpace = NumReservedValues;
1274 Op<0>() = ParentPad;
1276 setSubclassData<UnwindDestField>(
true);
1283 void CatchSwitchInst::growOperands(
unsigned Size) {
1285 assert(NumOperands >= 1);
1286 if (ReservedSpace >= NumOperands + Size)
1288 ReservedSpace = (NumOperands +
Size / 2) * 2;
1295 assert(OpNo < ReservedSpace &&
"Growing didn't work!");
1303 for (
Use *CurDst =
HI.getCurrent(); CurDst != EndDst; ++CurDst)
1304 *CurDst = *(CurDst + 1);
1315 const Twine &NameStr) {
1325 FPI.getNumOperands(),
1326 FPI.getNumOperands()) {
1337 init(ParentPad,
Args, NameStr);
1346 init(ParentPad,
Args, NameStr);
1365 void BranchInst::AssertOK() {
1368 "May only branch on boolean predicates!");
1375 assert(IfTrue &&
"Branch destination may not be null!");
1396 assert(IfTrue &&
"Branch destination may not be null!");
1416 BI.getNumOperands()) {
1420 Op<-3>() = BI.
Op<-3>();
1421 Op<-2>() = BI.
Op<-2>();
1423 Op<-1>() = BI.
Op<-1>();
1429 "Cannot swap successors of an unconditional branch");
1445 assert(!isa<BasicBlock>(Amt) &&
1446 "Passed basic block into allocation size parameter! Use other ctor");
1448 "Allocation array size is not an integer!");
1454 assert(
BB &&
"Insertion BB cannot be null when alignment not provided!");
1456 "BB must be in a Function when alignment not provided!");
1458 return DL.getPrefTypeAlign(Ty);
1462 assert(
I &&
"Insertion position cannot be null when alignment not provided!");
1468 :
AllocaInst(Ty, AddrSpace, nullptr, Name, InsertBefore) {}
1472 :
AllocaInst(Ty, AddrSpace, nullptr, Name, InsertAtEnd) {}
1490 getAISize(Ty->getContext(), ArraySize), InsertBefore),
1500 getAISize(Ty->getContext(), ArraySize), InsertAtEnd),
1510 return !CI->isOne();
1530 void LoadInst::AssertOK() {
1532 "Ptr must have pointer type.");
1536 assert(
BB &&
"Insertion BB cannot be null when alignment not provided!");
1538 "BB must be in a Function when alignment not provided!");
1540 return DL.getABITypeAlign(Ty);
1544 assert(
I &&
"Insertion position cannot be null when alignment not provided!");
1569 SyncScope::System, InsertBef) {}
1574 SyncScope::System, InsertAE) {}
1580 assert(cast<PointerType>(
Ptr->getType())->isOpaqueOrPointeeTypeMatches(Ty));
1592 assert(cast<PointerType>(
Ptr->getType())->isOpaqueOrPointeeTypeMatches(Ty));
1604 void StoreInst::AssertOK() {
1607 "Ptr must have pointer type!");
1610 "Ptr must be a pointer to Val type!");
1634 SyncScope::System, InsertBefore) {}
1639 SyncScope::System, InsertAtEnd) {}
1687 "All operands must be non-null!");
1689 "Ptr must have pointer type!");
1692 "Ptr must be a pointer to Cmp type!");
1695 "Ptr must be a pointer to NewVal type!");
1697 "Cmp type and NewVal type must be same!");
1710 Init(
Ptr, Cmp, NewVal, Alignment, SuccessOrdering, FailureOrdering, SSID);
1723 Init(
Ptr, Cmp, NewVal, Alignment, SuccessOrdering, FailureOrdering, SSID);
1734 "atomicrmw instructions can only be atomic.");
1736 "atomicrmw instructions cannot be unordered.");
1745 "All operands must be non-null!");
1747 "Ptr must have pointer type!");
1750 "Ptr must be a pointer to Val type!");
1752 "AtomicRMW instructions must be atomic!");
1810 return "<invalid operation>";
1841 const Twine &Name) {
1843 "NumOperands not initialized?");
1852 GEPI.getNumOperands(),
1853 GEPI.getNumOperands()),
1854 SourceElementType(GEPI.SourceElementType),
1855 ResultElementType(GEPI.ResultElementType) {
1861 if (
auto *
Struct = dyn_cast<StructType>(Ty)) {
1862 if (!
Struct->indexValid(Idx))
1864 return Struct->getTypeAtIndex(Idx);
1868 if (
auto *Array = dyn_cast<ArrayType>(Ty))
1869 return Array->getElementType();
1870 if (
auto *
Vector = dyn_cast<VectorType>(Ty))
1871 return Vector->getElementType();
1876 if (
auto *
Struct = dyn_cast<StructType>(Ty)) {
1877 if (Idx >=
Struct->getNumElements())
1879 return Struct->getElementType(Idx);
1881 if (
auto *Array = dyn_cast<ArrayType>(Ty))
1882 return Array->getElementType();
1883 if (
auto *
Vector = dyn_cast<VectorType>(Ty))
1884 return Vector->getElementType();
1888 template <
typename IndexTy>
1890 if (IdxList.
empty())
1892 for (IndexTy V : IdxList.
slice(1)) {
1919 if (!CI->isZero())
return false;
1939 cast<GEPOperator>(
this)->setIsInBounds(
B);
1943 return cast<GEPOperator>(
this)->isInBounds();
1949 return cast<GEPOperator>(
this)->accumulateConstantOffset(
DL,
Offset);
1955 APInt &ConstantOffset)
const {
1957 return cast<GEPOperator>(
this)->collectOffset(
DL,
BitWidth, VariableOffsets,
1973 "Invalid extractelement instruction operands!");
1987 "Invalid extractelement instruction operands!");
2011 "Invalid insertelement instruction operands!");
2025 "Invalid insertelement instruction operands!");
2038 if (Elt->
getType() != cast<VectorType>(Vec->
getType())->getElementType())
2041 if (!
Index->getType()->isIntegerTy())
2051 assert(V &&
"Cannot create placeholder of nullptr V");
2085 "Invalid shuffle vector instruction operands!");
2103 "Invalid shuffle vector instruction operands!");
2122 "Invalid shuffle vector instruction operands!");
2137 "Invalid shuffle vector instruction operands!");
2146 int NumOpElts = cast<FixedVectorType>(Op<0>()->
getType())->getNumElements();
2147 int NumMaskElts = ShuffleMask.size();
2149 for (
int i = 0;
i != NumMaskElts; ++
i) {
2155 assert(MaskElt >= 0 && MaskElt < 2 * NumOpElts &&
"Out-of-range mask");
2156 MaskElt = (MaskElt < NumOpElts) ? MaskElt + NumOpElts : MaskElt - NumOpElts;
2157 NewMask[
i] = MaskElt;
2160 Op<0>().swap(Op<1>());
2171 cast<VectorType>(V1->
getType())->getElementCount().getKnownMinValue();
2172 for (
int Elem :
Mask)
2176 if (isa<ScalableVectorType>(V1->
getType()))
2191 auto *MaskTy = dyn_cast<VectorType>(
Mask->getType());
2192 if (!MaskTy || !MaskTy->getElementType()->isIntegerTy(32) ||
2193 isa<ScalableVectorType>(MaskTy) != isa<ScalableVectorType>(V1->
getType()))
2197 if (isa<UndefValue>(
Mask) || isa<ConstantAggregateZero>(
Mask))
2200 if (
const auto *MV = dyn_cast<ConstantVector>(
Mask)) {
2201 unsigned V1Size = cast<FixedVectorType>(V1->
getType())->getNumElements();
2202 for (
Value *
Op : MV->operands()) {
2203 if (
auto *CI = dyn_cast<ConstantInt>(
Op)) {
2204 if (CI->uge(V1Size*2))
2206 }
else if (!isa<UndefValue>(
Op)) {
2213 if (
const auto *CDS = dyn_cast<ConstantDataSequential>(
Mask)) {
2214 unsigned V1Size = cast<FixedVectorType>(V1->
getType())->getNumElements();
2215 for (
unsigned i = 0,
e = cast<FixedVectorType>(MaskTy)->getNumElements();
2217 if (CDS->getElementAsInteger(
i) >= V1Size*2)
2229 if (isa<ConstantAggregateZero>(
Mask)) {
2230 Result.resize(EC.getKnownMinValue(), 0);
2234 Result.reserve(EC.getKnownMinValue());
2236 if (EC.isScalable()) {
2237 assert((isa<ConstantAggregateZero>(
Mask) || isa<UndefValue>(
Mask)) &&
2238 "Scalable vector shuffle mask must be undef or zeroinitializer");
2239 int MaskVal = isa<UndefValue>(
Mask) ? -1 : 0;
2240 for (
unsigned I = 0;
I < EC.getKnownMinValue(); ++
I)
2241 Result.emplace_back(MaskVal);
2245 unsigned NumElts = EC.getKnownMinValue();
2247 if (
auto *CDS = dyn_cast<ConstantDataSequential>(
Mask)) {
2248 for (
unsigned i = 0;
i != NumElts; ++
i)
2249 Result.push_back(CDS->getElementAsInteger(
i));
2252 for (
unsigned i = 0;
i != NumElts; ++
i) {
2254 Result.push_back(isa<UndefValue>(
C) ? -1 :
2255 cast<ConstantInt>(
C)->getZExtValue());
2267 if (isa<ScalableVectorType>(ResultTy)) {
2275 for (
int Elem :
Mask) {
2285 assert(!
Mask.empty() &&
"Shuffle mask must contain elements");
2286 bool UsesLHS =
false;
2287 bool UsesRHS =
false;
2288 for (
int I :
Mask) {
2291 assert(
I >= 0 &&
I < (NumOpElts * 2) &&
2292 "Out-of-bounds shuffle mask element");
2293 UsesLHS |= (
I < NumOpElts);
2294 UsesRHS |= (
I >= NumOpElts);
2295 if (UsesLHS && UsesRHS)
2299 return UsesLHS || UsesRHS;
2311 for (
int i = 0, NumMaskElts =
Mask.size();
i < NumMaskElts; ++
i) {
2331 int NumElts =
Mask.size();
2335 for (
int i = 0;
i < NumElts; ++
i) {
2338 if (
Mask[
i] != (NumElts - 1 -
i) &&
Mask[
i] != (NumElts + NumElts - 1 -
i))
2347 for (
int i = 0, NumElts =
Mask.size();
i < NumElts; ++
i) {
2360 for (
int i = 0, NumElts =
Mask.size();
i < NumElts; ++
i) {
2377 int NumElts =
Mask.size();
2387 if ((
Mask[1] -
Mask[0]) != NumElts)
2392 for (
int i = 2;
i < NumElts; ++
i) {
2393 int MaskEltVal =
Mask[
i];
2394 if (MaskEltVal == -1)
2396 int MaskEltPrevVal =
Mask[
i - 2];
2397 if (MaskEltVal - MaskEltPrevVal != 2)
2405 int StartIndex = -1;
2406 for (
int I = 0,
E =
Mask.size();
I !=
E; ++
I) {
2407 int MaskEltVal =
Mask[
I];
2408 if (MaskEltVal == -1)
2411 if (StartIndex == -1) {
2414 if (MaskEltVal <
I ||
E <= (MaskEltVal -
I))
2417 StartIndex = MaskEltVal -
I;
2422 if (MaskEltVal != (StartIndex +
I))
2426 if (StartIndex == -1)
2435 int NumSrcElts,
int &
Index) {
2441 if (NumSrcElts <= (
int)
Mask.size())
2446 for (
int i = 0,
e =
Mask.size();
i !=
e; ++
i) {
2451 if (0 <= SubIndex && SubIndex !=
Offset)
2456 if (0 <= SubIndex && SubIndex + (
int)
Mask.size() <= NumSrcElts) {
2464 int NumSrcElts,
int &NumSubElts,
2466 int NumMaskElts =
Mask.size();
2469 if (NumMaskElts < NumSrcElts)
2480 bool Src0Identity =
true;
2481 bool Src1Identity =
true;
2483 for (
int i = 0;
i != NumMaskElts; ++
i) {
2489 if (
M < NumSrcElts) {
2491 Src0Identity &= (
M ==
i);
2495 Src1Identity &= (
M == (
i + NumSrcElts));
2497 assert((Src0Elts | Src1Elts | UndefElts).isAllOnes() &&
2498 "unknown shuffle elements");
2500 "2-source shuffle not found");
2512 int NumSub1Elts = Src1Hi - Src1Lo;
2515 NumSubElts = NumSub1Elts;
2524 int NumSub0Elts = Src0Hi - Src0Lo;
2527 NumSubElts = NumSub0Elts;
2537 if (isa<UndefValue>(Op<2>()))
2542 if (isa<ScalableVectorType>(
getType()))
2545 int NumOpElts = cast<FixedVectorType>(Op<0>()->
getType())->getNumElements();
2546 int NumMaskElts = cast<FixedVectorType>(
getType())->getNumElements();
2547 if (NumMaskElts <= NumOpElts)
2556 for (
int i = NumOpElts;
i < NumMaskElts; ++
i)
2564 if (isa<UndefValue>(Op<2>()))
2569 if (isa<ScalableVectorType>(
getType()))
2572 int NumOpElts = cast<FixedVectorType>(Op<0>()->
getType())->getNumElements();
2573 int NumMaskElts = cast<FixedVectorType>(
getType())->getNumElements();
2574 if (NumMaskElts >= NumOpElts)
2582 if (isa<UndefValue>(Op<0>()) || isa<UndefValue>(Op<1>()) ||
2583 isa<UndefValue>(Op<2>()))
2588 if (isa<ScalableVectorType>(
getType()))
2591 int NumOpElts = cast<FixedVectorType>(Op<0>()->
getType())->getNumElements();
2592 int NumMaskElts = cast<FixedVectorType>(
getType())->getNumElements();
2593 if (NumMaskElts != NumOpElts * 2)
2604 int ReplicationFactor,
int VF) {
2605 assert(
Mask.size() == (
unsigned)ReplicationFactor * VF &&
2606 "Unexpected mask size.");
2608 for (
int CurrElt :
seq(0, VF)) {
2610 assert(CurrSubMask.
size() == (
unsigned)ReplicationFactor &&
2611 "Run out of mask?");
2612 Mask =
Mask.drop_front(ReplicationFactor);
2613 if (!
all_of(CurrSubMask, [CurrElt](
int MaskElt) {
2618 assert(
Mask.empty() &&
"Did not consume the whole mask?");
2624 int &ReplicationFactor,
int &VF) {
2628 Mask.take_while([](
int MaskElt) {
return MaskElt == 0; }).
size();
2629 if (ReplicationFactor == 0 ||
Mask.size() % ReplicationFactor != 0)
2631 VF =
Mask.size() / ReplicationFactor;
2643 for (
int MaskElt :
Mask) {
2647 if (MaskElt < Largest)
2649 Largest =
std::max(Largest, MaskElt);
2653 for (
int PossibleReplicationFactor :
2654 reverse(seq_inclusive<unsigned>(1,
Mask.size()))) {
2655 if (
Mask.size() % PossibleReplicationFactor != 0)
2657 int PossibleVF =
Mask.size() / PossibleReplicationFactor;
2661 ReplicationFactor = PossibleReplicationFactor;
2673 if (isa<ScalableVectorType>(
getType()))
2676 VF = cast<FixedVectorType>(Op<0>()->
getType())->getNumElements();
2677 if (ShuffleMask.size() % VF != 0)
2679 ReplicationFactor = ShuffleMask.size() / VF;
2685 if (VF <= 0 ||
Mask.size() <
static_cast<unsigned>(VF) ||
2686 Mask.size() % VF != 0)
2688 for (
unsigned K = 0, Sz =
Mask.size(); K < Sz; K += VF) {
2693 for_each(SubMask, [&Used, VF](
int Idx) {
2707 if (isa<ScalableVectorType>(
getType()))
2720 const Twine &Name) {
2727 assert(!Idxs.
empty() &&
"InsertValueInst must have at least one index");
2730 Val->
getType() &&
"Inserted value must match indexed type!");
2741 Indices(IVI.Indices) {
2756 assert(!Idxs.
empty() &&
"ExtractValueInst must have at least one index");
2764 Indices(EVI.Indices) {
2776 for (
unsigned Index : Idxs) {
2783 if (
ArrayType *AT = dyn_cast<ArrayType>(Agg)) {
2784 if (
Index >= AT->getNumElements())
2786 Agg = AT->getElementType();
2787 }
else if (
StructType *
ST = dyn_cast<StructType>(Agg)) {
2788 if (
Index >=
ST->getNumElements())
2790 Agg =
ST->getElementType(
Index);
2796 return const_cast<Type*
>(Agg);
2835 void UnaryOperator::AssertOK() {
2842 "Unary operation should return same type as operand!");
2844 "Tried to create a floating-point operation on a "
2845 "non-floating-point type!");
2882 void BinaryOperator::AssertOK() {
2886 "Binary operator operand types must match!");
2892 "Arithmetic operation should return same type as operands!");
2894 "Tried to create an integer operation on a non-integer type!");
2896 case FAdd:
case FSub:
2899 "Arithmetic operation should return same type as operands!");
2901 "Tried to create a floating-point operation on a "
2902 "non-floating-point type!");
2907 "Arithmetic operation should return same type as operands!");
2909 "Incorrect operand type (not integer) for S/UDIV");
2913 "Arithmetic operation should return same type as operands!");
2915 "Incorrect operand type (not floating point) for FDIV");
2920 "Arithmetic operation should return same type as operands!");
2922 "Incorrect operand type (not integer) for S/UREM");
2926 "Arithmetic operation should return same type as operands!");
2928 "Incorrect operand type (not floating point) for FREM");
2934 "Shift operation should return same type as operands!");
2936 "Tried to create a shift operation on a non-integral type!");
2941 "Logical operation should return same type as operands!");
2943 "Tried to create a logical operation on a non-integral type!");
2954 "Cannot create binary operator with two operands of differing type!");
2985 return BinaryOperator::CreateNSWSub(
zero,
Op, Name, InsertBefore);
2991 return BinaryOperator::CreateNSWSub(
zero,
Op, Name, InsertAtEnd);
2997 return BinaryOperator::CreateNUWSub(
zero,
Op, Name, InsertBefore);
3003 return BinaryOperator::CreateNUWSub(
zero,
Op, Name, InsertAtEnd);
3027 Op<0>().swap(Op<1>());
3037 cast<Instruction>(
this)->getMetadata(LLVMContext::MD_fpmath);
3051 default:
return false;
3052 case Instruction::ZExt:
3053 case Instruction::SExt:
3054 case Instruction::Trunc:
3056 case Instruction::BitCast:
3064 if (
getOpcode() != Instruction::BitCast)
3094 case Instruction::Trunc:
3095 case Instruction::ZExt:
3096 case Instruction::SExt:
3097 case Instruction::FPTrunc:
3098 case Instruction::FPExt:
3099 case Instruction::UIToFP:
3100 case Instruction::SIToFP:
3101 case Instruction::FPToUI:
3102 case Instruction::FPToSI:
3103 case Instruction::AddrSpaceCast:
3106 case Instruction::BitCast:
3108 case Instruction::PtrToInt:
3109 return DL.getIntPtrType(SrcTy)->getScalarSizeInBits() ==
3111 case Instruction::IntToPtr:
3112 return DL.getIntPtrType(DestTy)->getScalarSizeInBits() ==
3132 Type *DstIntPtrTy) {
3163 const unsigned numCastOps =
3164 Instruction::CastOpsEnd - Instruction::CastOpsBegin;
3165 static const uint8_t CastResults[numCastOps][numCastOps] = {
3171 { 1, 0, 0,99,99, 0, 0,99,99,99, 0, 3, 0},
3172 { 8, 1, 9,99,99, 2,17,99,99,99, 2, 3, 0},
3173 { 8, 0, 1,99,99, 0, 2,99,99,99, 0, 3, 0},
3174 { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3, 0},
3175 { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3, 0},
3176 { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0},
3177 { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0},
3178 { 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0},
3179 { 99,99,99, 2, 2,99,99, 8, 2,99,99, 4, 0},
3180 { 1, 0, 0,99,99, 0, 0,99,99,99, 7, 3, 0},
3181 { 99,99,99,99,99,99,99,99,99,11,99,15, 0},
3182 { 5, 5, 5, 6, 6, 5, 5, 6, 6,16, 5, 1,14},
3183 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12},
3190 bool IsFirstBitcast = (firstOp == Instruction::BitCast);
3191 bool IsSecondBitcast = (secondOp == Instruction::BitCast);
3192 bool AreBothBitcasts = IsFirstBitcast && IsSecondBitcast;
3195 if ((IsFirstBitcast && isa<VectorType>(SrcTy) != isa<VectorType>(MidTy)) ||
3196 (IsSecondBitcast && isa<VectorType>(MidTy) != isa<VectorType>(DstTy)))
3197 if (!AreBothBitcasts)
3200 int ElimCase = CastResults[firstOp-Instruction::CastOpsBegin]
3201 [secondOp-Instruction::CastOpsBegin];
3252 return Instruction::BitCast;
3255 if (!SrcIntPtrTy || DstIntPtrTy != SrcIntPtrTy)
3258 if (MidSize >= PtrSize)
3259 return Instruction::BitCast;
3269 return Instruction::BitCast;
3270 if (SrcSize < DstSize)
3272 if (SrcSize > DstSize)
3278 return Instruction::ZExt;
3286 if (SrcSize <= PtrSize && SrcSize == DstSize)
3287 return Instruction::BitCast;
3294 return Instruction::AddrSpaceCast;
3295 return Instruction::BitCast;
3306 "Illegal addrspacecast, bitcast sequence!");
3315 return Instruction::AddrSpaceCast;
3327 "Illegal inttoptr, bitcast sequence!");
3339 "Illegal bitcast, ptrtoint sequence!");
3344 return Instruction::UIToFP;
3359 case Trunc:
return new TruncInst (
S, Ty, Name, InsertBefore);
3360 case ZExt:
return new ZExtInst (
S, Ty, Name, InsertBefore);
3361 case SExt:
return new SExtInst (
S, Ty, Name, InsertBefore);
3362 case FPTrunc:
return new FPTruncInst (
S, Ty, Name, InsertBefore);
3363 case FPExt:
return new FPExtInst (
S, Ty, Name, InsertBefore);
3364 case UIToFP:
return new UIToFPInst (
S, Ty, Name, InsertBefore);
3365 case SIToFP:
return new SIToFPInst (
S, Ty, Name, InsertBefore);
3366 case FPToUI:
return new FPToUIInst (
S, Ty, Name, InsertBefore);
3367 case FPToSI:
return new FPToSIInst (
S, Ty, Name, InsertBefore);
3368 case PtrToInt:
return new PtrToIntInst (
S, Ty, Name, InsertBefore);
3369 case IntToPtr:
return new IntToPtrInst (
S, Ty, Name, InsertBefore);
3370 case BitCast:
return new BitCastInst (
S, Ty, Name, InsertBefore);
3381 case Trunc:
return new TruncInst (
S, Ty, Name, InsertAtEnd);
3382 case ZExt:
return new ZExtInst (
S, Ty, Name, InsertAtEnd);
3383 case SExt:
return new SExtInst (
S, Ty, Name, InsertAtEnd);
3384 case FPTrunc:
return new FPTruncInst (
S, Ty, Name, InsertAtEnd);
3385 case FPExt:
return new FPExtInst (
S, Ty, Name, InsertAtEnd);
3386 case UIToFP:
return new UIToFPInst (
S, Ty, Name, InsertAtEnd);
3387 case SIToFP:
return new SIToFPInst (
S, Ty, Name, InsertAtEnd);
3388 case FPToUI:
return new FPToUIInst (
S, Ty, Name, InsertAtEnd);
3389 case FPToSI:
return new FPToSIInst (
S, Ty, Name, InsertAtEnd);
3390 case PtrToInt:
return new PtrToIntInst (
S, Ty, Name, InsertAtEnd);
3391 case IntToPtr:
return new IntToPtrInst (
S, Ty, Name, InsertAtEnd);
3392 case BitCast:
return new BitCastInst (
S, Ty, Name, InsertAtEnd);
3402 return Create(Instruction::BitCast,
S, Ty, Name, InsertBefore);
3403 return Create(Instruction::ZExt,
S, Ty, Name, InsertBefore);
3410 return Create(Instruction::BitCast,
S, Ty, Name, InsertAtEnd);
3411 return Create(Instruction::ZExt,
S, Ty, Name, InsertAtEnd);
3418 return Create(Instruction::BitCast,
S, Ty, Name, InsertBefore);
3419 return Create(Instruction::SExt,
S, Ty, Name, InsertBefore);
3426 return Create(Instruction::BitCast,
S, Ty, Name, InsertAtEnd);
3427 return Create(Instruction::SExt,
S, Ty, Name, InsertAtEnd);
3434 return Create(Instruction::BitCast,
S, Ty, Name, InsertBefore);
3435 return Create(Instruction::Trunc,
S, Ty, Name, InsertBefore);
3442 return Create(Instruction::BitCast,
S, Ty, Name, InsertAtEnd);
3443 return Create(Instruction::Trunc,
S, Ty, Name, InsertAtEnd);
3449 assert(
S->getType()->isPtrOrPtrVectorTy() &&
"Invalid cast");
3454 cast<VectorType>(Ty)->getElementCount() ==
3455 cast<VectorType>(
S->getType())->getElementCount()) &&
3459 return Create(Instruction::PtrToInt,
S, Ty, Name, InsertAtEnd);
3468 assert(
S->getType()->isPtrOrPtrVectorTy() &&
"Invalid cast");
3473 cast<VectorType>(Ty)->getElementCount() ==
3474 cast<VectorType>(
S->getType())->getElementCount()) &&
3478 return Create(Instruction::PtrToInt,
S, Ty, Name, InsertBefore);
3487 assert(
S->getType()->isPtrOrPtrVectorTy() &&
"Invalid cast");
3491 return Create(Instruction::AddrSpaceCast,
S, Ty, Name, InsertAtEnd);
3493 return Create(Instruction::BitCast,
S, Ty, Name, InsertAtEnd);
3500 assert(
S->getType()->isPtrOrPtrVectorTy() &&
"Invalid cast");
3504 return Create(Instruction::AddrSpaceCast,
S, Ty, Name, InsertBefore);
3506 return Create(Instruction::BitCast,
S, Ty, Name, InsertBefore);
3513 return Create(Instruction::PtrToInt,
S, Ty, Name, InsertBefore);
3515 return Create(Instruction::IntToPtr,
S, Ty, Name, InsertBefore);
3517 return Create(Instruction::BitCast,
S, Ty, Name, InsertBefore);
3524 "Invalid integer cast");
3525 unsigned SrcBits =
C->getType()->getScalarSizeInBits();
3528 (SrcBits == DstBits ? Instruction::BitCast :
3529 (SrcBits > DstBits ? Instruction::Trunc :
3530 (
isSigned ? Instruction::SExt : Instruction::ZExt)));
3531 return Create(opcode,
C, Ty, Name, InsertBefore);
3539 unsigned SrcBits =
C->getType()->getScalarSizeInBits();
3542 (SrcBits == DstBits ? Instruction::BitCast :
3543 (SrcBits > DstBits ? Instruction::Trunc :
3544 (
isSigned ? Instruction::SExt : Instruction::ZExt)));
3545 return Create(opcode,
C, Ty, Name, InsertAtEnd);
3553 unsigned SrcBits =
C->getType()->getScalarSizeInBits();
3556 (SrcBits == DstBits ? Instruction::BitCast :
3557 (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
3558 return Create(opcode,
C, Ty, Name, InsertBefore);
3566 unsigned SrcBits =
C->getType()->getScalarSizeInBits();
3569 (SrcBits == DstBits ? Instruction::BitCast :
3570 (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
3571 return Create(opcode,
C, Ty, Name, InsertAtEnd);
3578 if (SrcTy == DestTy)
3581 if (
VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) {
3582 if (
VectorType *DestVecTy = dyn_cast<VectorType>(DestTy)) {
3583 if (SrcVecTy->getElementCount() == DestVecTy->getElementCount()) {
3585 SrcTy = SrcVecTy->getElementType();
3586 DestTy = DestVecTy->getElementType();
3591 if (
PointerType *DestPtrTy = dyn_cast<PointerType>(DestTy)) {
3592 if (
PointerType *SrcPtrTy = dyn_cast<PointerType>(SrcTy)) {
3593 return SrcPtrTy->getAddressSpace() == DestPtrTy->getAddressSpace();
3605 if (SrcBits != DestBits)
3617 if (
auto *PtrTy = dyn_cast<PointerType>(SrcTy))
3618 if (
auto *IntTy = dyn_cast<IntegerType>(DestTy))
3619 return (IntTy->getBitWidth() ==
DL.getPointerTypeSizeInBits(PtrTy) &&
3620 !
DL.isNonIntegralPointerType(PtrTy));
3621 if (
auto *PtrTy = dyn_cast<PointerType>(DestTy))
3622 if (
auto *IntTy = dyn_cast<IntegerType>(SrcTy))
3623 return (IntTy->getBitWidth() ==
DL.getPointerTypeSizeInBits(PtrTy) &&
3624 !
DL.isNonIntegralPointerType(PtrTy));
3637 const Value *Src,
bool SrcIsSigned,
Type *DestTy,
bool DestIsSigned) {
3638 Type *SrcTy = Src->getType();
3641 "Only first class types are castable!");
3643 if (SrcTy == DestTy)
3647 if (
VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy))
3648 if (
VectorType *DestVecTy = dyn_cast<VectorType>(DestTy))
3649 if (SrcVecTy->getElementCount() == DestVecTy->getElementCount()) {
3652 SrcTy = SrcVecTy->getElementType();
3653 DestTy = DestVecTy->getElementType();
3663 if (DestBits < SrcBits)
3665 else if (DestBits > SrcBits) {
3679 assert(DestBits == SrcBits &&
3680 "Casting vector to integer of different width");
3684 "Casting from a value that is not first-class type");
3694 if (DestBits < SrcBits) {
3696 }
else if (DestBits > SrcBits) {
3702 assert(DestBits == SrcBits &&
3703 "Casting vector to floating point of different width");
3708 assert(DestBits == SrcBits &&
3709 "Illegal cast to vector (wrong type or size)");
3714 return AddrSpaceCast;
3722 assert(DestBits == SrcBits &&
"Casting vector of wrong width to X86_MMX");
3746 bool SrcIsVec = isa<VectorType>(SrcTy);
3747 bool DstIsVec = isa<VectorType>(DstTy);
3754 ElementCount SrcEC = SrcIsVec ? cast<VectorType>(SrcTy)->getElementCount()
3756 ElementCount DstEC = DstIsVec ? cast<VectorType>(DstTy)->getElementCount()
3761 default:
return false;
3762 case Instruction::Trunc:
3764 SrcEC == DstEC && SrcScalarBitSize > DstScalarBitSize;
3765 case Instruction::ZExt:
3767 SrcEC == DstEC && SrcScalarBitSize < DstScalarBitSize;
3768 case Instruction::SExt:
3770 SrcEC == DstEC && SrcScalarBitSize < DstScalarBitSize;
3771 case Instruction::FPTrunc:
3773 SrcEC == DstEC && SrcScalarBitSize > DstScalarBitSize;
3774 case Instruction::FPExt:
3776 SrcEC == DstEC && SrcScalarBitSize < DstScalarBitSize;
3777 case Instruction::UIToFP:
3778 case Instruction::SIToFP:
3781 case Instruction::FPToUI:
3782 case Instruction::FPToSI:
3785 case Instruction::PtrToInt:
3789 case Instruction::IntToPtr:
3793 case Instruction::BitCast: {
3799 if (!SrcPtrTy != !DstPtrTy)
3812 if (SrcIsVec && DstIsVec)
3813 return SrcEC == DstEC;
3821 case Instruction::AddrSpaceCast: {
3833 return SrcEC == DstEC;
3840 ) :
CastInst(Ty, Trunc,
S, Name, InsertBefore) {
3846 ) :
CastInst(Ty, Trunc,
S, Name, InsertAtEnd) {
3852 ) :
CastInst(Ty, ZExt,
S, Name, InsertBefore) {
3858 ) :
CastInst(Ty, ZExt,
S, Name, InsertAtEnd) {
3863 ) :
CastInst(Ty, SExt,
S, Name, InsertBefore) {
3869 ) :
CastInst(Ty, SExt,
S, Name, InsertAtEnd) {
3875 ) :
CastInst(Ty, FPTrunc,
S, Name, InsertBefore) {
3881 ) :
CastInst(Ty, FPTrunc,
S, Name, InsertAtEnd) {
3887 ) :
CastInst(Ty, FPExt,
S, Name, InsertBefore) {
3893 ) :
CastInst(Ty, FPExt,
S, Name, InsertAtEnd) {
3899 ) :
CastInst(Ty, UIToFP,
S, Name, InsertBefore) {
3905 ) :
CastInst(Ty, UIToFP,
S, Name, InsertAtEnd) {
3911 ) :
CastInst(Ty, SIToFP,
S, Name, InsertBefore) {
3917 ) :
CastInst(Ty, SIToFP,
S, Name, InsertAtEnd) {
3923 ) :
CastInst(Ty, FPToUI,
S, Name, InsertBefore) {
3929 ) :
CastInst(Ty, FPToUI,
S, Name, InsertAtEnd) {
3935 ) :
CastInst(Ty, FPToSI,
S, Name, InsertBefore) {
3941 ) :
CastInst(Ty, FPToSI,
S, Name, InsertAtEnd) {
3947 ) :
CastInst(Ty, PtrToInt,
S, Name, InsertBefore) {
3953 ) :
CastInst(Ty, PtrToInt,
S, Name, InsertAtEnd) {
3959 ) :
CastInst(Ty, IntToPtr,
S, Name, InsertBefore) {
3965 ) :
CastInst(Ty, IntToPtr,
S, Name, InsertAtEnd) {
3971 ) :
CastInst(Ty, BitCast,
S, Name, InsertBefore) {
3977 ) :
CastInst(Ty, BitCast,
S, Name, InsertAtEnd) {
3983 ) :
CastInst(Ty, AddrSpaceCast,
S, Name, InsertBefore) {
3989 ) :
CastInst(Ty, AddrSpaceCast,
S, Name, InsertAtEnd) {
4027 if (
Op == Instruction::ICmp) {
4047 if (
Op == Instruction::ICmp) {
4056 if (
ICmpInst *IC = dyn_cast<ICmpInst>(
this))
4059 cast<FCmpInst>(
this)->swapOperands();
4063 if (
const ICmpInst *IC = dyn_cast<ICmpInst>(
this))
4064 return IC->isCommutative();
4065 return cast<FCmpInst>(
this)->isCommutative();
4111 default:
return "unknown";
4321 switch (predicate) {
4322 default:
return false;
4329 switch (predicate) {
4330 default:
return false;
4340 case ICmpInst::Predicate::ICMP_EQ:
4342 case ICmpInst::Predicate::ICMP_NE:
4344 case ICmpInst::Predicate::ICMP_UGT:
4346 case ICmpInst::Predicate::ICMP_UGE:
4348 case ICmpInst::Predicate::ICMP_ULT:
4350 case ICmpInst::Predicate::ICMP_ULE:
4352 case ICmpInst::Predicate::ICMP_SGT:
4354 case ICmpInst::Predicate::ICMP_SGE:
4356 case ICmpInst::Predicate::ICMP_SLT:
4358 case ICmpInst::Predicate::ICMP_SLE:
4408 "Call only with non-equality predicates!");
4419 switch (predicate) {
4420 default:
return false;
4428 switch (predicate) {
4429 default:
return false;
4438 default:
return false;
4448 default:
return false;
4487 ReservedSpace = NumReserved;
4502 nullptr, 0, InsertBefore) {
4513 nullptr, 0, InsertAtEnd) {