15#ifndef LLVM_IR_INSTRUCTIONS_H
16#define LLVM_IR_INSTRUCTIONS_H
73 "Bitfields must be contiguous");
134 setSubclassData<AlignmentField>(
Log2(
Align));
150 setSubclassData<UsedWithInAllocaField>(V);
160 return (
I->getOpcode() == Instruction::Alloca);
169 template <
typename Bitfield>
170 void setSubclassData(
typename Bitfield::Type
Value) {
196 OrderingField, ElementWiseField>(),
197 "Bitfields must be contiguous");
240 setSubclassData<AlignmentField>(
Log2(
Align));
250 setSubclassData<OrderingField>(Ordering);
306 return I->getOpcode() == Instruction::Load;
315 template <
typename Bitfield>
316 void setSubclassData(
typename Bitfield::Type
Value) {
337 "Bitfields must be contiguous");
364 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
365 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
381 setSubclassData<AlignmentField>(
Log2(
Align));
392 setSubclassData<OrderingField>(Ordering);
449 return I->getOpcode() == Instruction::Store;
458 template <
typename Bitfield>
459 void setSubclassData(
typename Bitfield::Type
Value) {
501 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
502 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
512 setSubclassData<OrderingField>(Ordering);
527 return I->getOpcode() == Instruction::Fence;
536 template <
typename Bitfield>
537 void setSubclassData(
typename Bitfield::Type
Value) {
562 template <
unsigned Offset>
563 using AtomicOrderingBitfieldElement =
582 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
583 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
596 "Bitfields must be contiguous");
605 setSubclassData<AlignmentField>(
Log2(
Align));
620 void setWeak(
bool IsWeak) { setSubclassData<WeakField>(IsWeak); }
645 "invalid CmpXchg success ordering");
646 setSubclassData<SuccessOrderingField>(Ordering);
657 "invalid CmpXchg failure ordering");
658 setSubclassData<FailureOrderingField>(Ordering);
709 switch (SuccessOrdering) {
725 return I->getOpcode() == Instruction::AtomicCmpXchg;
734 template <
typename Bitfield>
735 void setSubclassData(
typename Bitfield::Type
Value) {
848 template <
unsigned Offset>
849 using AtomicOrderingBitfieldElement =
853 template <
unsigned Offset>
854 using BinOpBitfieldElement =
857 constexpr static IntrusiveOperandsAllocMarker AllocMarker{2};
861 Align Alignment, AtomicOrdering Ordering,
863 InsertPosition InsertBefore =
nullptr);
866 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
867 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
878 "Bitfields must be contiguous");
901 setSubclassData<OperationField>(
Operation);
911 setSubclassData<AlignmentField>(
Log2(
Align));
939 "atomicrmw instructions can only be atomic.");
941 "atomicrmw instructions cannot be unordered.");
942 setSubclassData<AtomicOrderingField>(Ordering);
973 return I->getOpcode() == Instruction::AtomicRMW;
985 template <
typename Bitfield>
986 void setSubclassData(
typename Bitfield::Type
Value) {
1011 assert(Ty &&
"Invalid GetElementPtrInst indices for type!");
1019 Type *SourceElementType;
1020 Type *ResultElementType;
1028 inline GetElementPtrInst(
Type *PointeeType,
Value *Ptr,
1033 const Twine &NameStr);
1044 const Twine &NameStr =
"",
1047 assert(PointeeType &&
"Must specify element type");
1049 return new (AllocMarker) GetElementPtrInst(
1050 PointeeType, Ptr, IdxList, AllocMarker, NameStr, InsertBefore);
1055 const Twine &NameStr =
"",
1057 GetElementPtrInst *
GEP =
1058 Create(PointeeType, Ptr, IdxList, NameStr, InsertBefore);
1059 GEP->setNoWrapFlags(NW);
1067 const Twine &NameStr =
"",
1070 NameStr, InsertBefore);
1082 return ResultElementType;
1148 if (Ty->isVectorTy())
1151 for (
Value *Index : IdxList)
1211 APInt &ConstantOffset)
const;
1214 return (
I->getOpcode() == Instruction::GetElementPtr);
1225GetElementPtrInst::GetElementPtrInst(
Type *PointeeType,
Value *Ptr,
1231 SourceElementType(PointeeType),
1232 ResultElementType(getIndexedType(PointeeType, IdxList)) {
1233 init(Ptr, IdxList, NameStr);
1249 "Invalid ICmp predicate value");
1251 "Both operands to ICmp instruction are not of the same type!");
1255 "Invalid operand types for ICmp instruction");
1258 enum { SameSign = (1 << 0) };
1273 const Twine &NameStr =
""
1276 RHS, NameStr, InsertBefore) {
1287 const Twine &NameStr =
""
1371 LLVM_ABI static std::optional<bool>
1459 LLVM_ABI static std::optional<bool>
1464 return I->getOpcode() == Instruction::ICmp;
1483 "Both operands to FCmp instruction are not of the same type!");
1486 "Invalid operand types for FCmp instruction");
1502 const Twine &NameStr =
""
1505 RHS, NameStr, InsertBefore) {
1513 const Twine &NameStr =
"",
1568 return I->getOpcode() == Instruction::FCmp;
1592 : CallInst(Ty, Func, Args, {}, NameStr,
AllocInfo, InsertBefore) {}
1602 static unsigned ComputeNumOperands(
unsigned NumArgs,
1603 unsigned NumBundleInputs = 0) {
1606 return 1 + NumArgs + NumBundleInputs;
1619 return new (AllocMarker)
1620 CallInst(Ty,
F, NameStr, AllocMarker, InsertBefore);
1624 const Twine &NameStr,
1627 return new (AllocMarker)
1628 CallInst(Ty, Func, Args, {}, NameStr, AllocMarker, InsertBefore);
1633 const Twine &NameStr =
"",
1635 IntrusiveOperandsAndDescriptorAllocMarker AllocMarker{
1639 return new (AllocMarker)
1640 CallInst(Ty, Func, Args, Bundles, NameStr, AllocMarker, InsertBefore);
1645 return Create(Func.getFunctionType(), Func.getCallee(), NameStr,
1651 const Twine &NameStr =
"",
1653 return Create(Func.getFunctionType(), Func.getCallee(), Args, Bundles,
1654 NameStr, InsertBefore);
1658 const Twine &NameStr,
1660 return Create(Func.getFunctionType(), Func.getCallee(), Args, NameStr,
1686 "Bitfields must be contiguous");
1702 setSubclassData<TailCallKindField>(TCK);
1716 case Intrinsic::trap:
1717 case Intrinsic::ubsantrap:
1726 return I->getOpcode() == Instruction::Call;
1738 template <
typename Bitfield>
1739 void setSubclassData(
typename Bitfield::Type
Value) {
1751 init(Ty, Func, Args, Bundles, NameStr);
1765 :
Instruction(
S1->getType(), Instruction::Select, AllocMarker,
1786 const Twine &NameStr =
"",
1790 new (AllocMarker) SelectInst(
C,
S1, S2, NameStr, InsertBefore);
1825 return I->getOpcode() == Instruction::Select;
1865 return I->getOpcode() == VAArg;
1893 const Twine &NameStr =
"",
1895 return new (AllocMarker)
1896 ExtractElementInst(Vec, Idx, NameStr, InsertBefore);
1917 return I->getOpcode() == Instruction::ExtractElement;
1942 const Twine &NameStr =
"",
1953 const Twine &NameStr =
"",
1955 return new (AllocMarker)
1956 InsertElementInst(Vec, NewElt, Idx, NameStr, InsertBefore);
1975 return I->getOpcode() == Instruction::InsertElement;
2021 const Twine &NameStr =
"",
2024 const Twine &NameStr =
"",
2027 const Twine &NameStr =
"",
2030 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
2031 void operator delete(
void *Ptr) {
2032 return User::operator
delete(Ptr, AllocMarker);
2067 Result.assign(ShuffleMask.begin(), ShuffleMask.end());
2090 .getKnownMinValue();
2091 unsigned NumMaskElts = ShuffleMask.size();
2092 return NumSourceElts != NumMaskElts;
2101 .getKnownMinValue();
2102 unsigned NumMaskElts = ShuffleMask.size();
2103 return NumSourceElts < NumMaskElts;
2113 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2135 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2162 LLVM_ABI bool isIdentityWithPadding()
const;
2166 LLVM_ABI bool isIdentityWithExtract()
const;
2183 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2208 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2229 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2280 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2304 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2323 int NumSrcElts,
int &Index);
2326 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2353 int &NumSubElts,
int &Index);
2355 int &NumSubElts,
int &Index) {
2356 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2383 int &ReplicationFactor,
int &VF);
2386 assert(Mask->getType()->isVectorTy() &&
"Shuffle needs vector constant.");
2397 LLVM_ABI bool isReplicationMask(
int &ReplicationFactor,
int &VF)
const;
2412 LLVM_ABI bool isOneUseSingleSourceMask(
int VF)
const;
2417 unsigned InVecNumElts) {
2418 for (
int &Idx : Mask) {
2421 Idx = Idx < (int)InVecNumElts ? Idx + InVecNumElts : Idx - InVecNumElts;
2422 assert(Idx >= 0 && Idx < (
int)InVecNumElts * 2 &&
2423 "shufflevector mask index out of range");
2428 LLVM_ABI bool isInterleave(
unsigned Factor);
2450 isInterleaveMask(
ArrayRef<int> Mask,
unsigned Factor,
unsigned NumInputElts,
2453 unsigned NumInputElts) {
2481 unsigned EltSizeInBits,
2482 unsigned MinSubElts,
unsigned MaxSubElts,
2483 unsigned &NumSubElts,
2484 unsigned &RotateAmt);
2488 return I->getOpcode() == Instruction::ShuffleVector;
2511 ExtractValueInst(
const ExtractValueInst &EVI);
2530 const Twine &NameStr =
"",
2533 ExtractValueInst(Agg, Idxs, NameStr, InsertBefore);
2565 return (
unsigned)Indices.size();
2574 return I->getOpcode() == Instruction::ExtractValue;
2581ExtractValueInst::ExtractValueInst(Value *Agg, ArrayRef<unsigned> Idxs,
2582 const Twine &NameStr,
2583 InsertPosition InsertBefore)
2585 ExtractValue, Agg, InsertBefore) {
2586 init(Idxs, NameStr);
2601 InsertValueInst(
const InsertValueInst &IVI);
2612 InsertValueInst(
Value *Agg,
Value *Val,
unsigned Idx,
2613 const Twine &NameStr =
"",
2617 const Twine &NameStr);
2627 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
2628 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
2632 const Twine &NameStr =
"",
2634 return new InsertValueInst(Agg, Val, Idxs, NameStr, InsertBefore);
2673 return (
unsigned)Indices.size();
2682 return I->getOpcode() == Instruction::InsertValue;
2694InsertValueInst::InsertValueInst(
Value *Agg,
Value *Val,
2698 init(Agg, Val, Idxs, NameStr);
2716 unsigned ReservedSpace;
2718 PHINode(
const PHINode &PN);
2720 explicit PHINode(
Type *Ty,
unsigned NumReservedValues,
2721 const Twine &NameStr =
"",
2723 :
Instruction(Ty, Instruction::PHI, AllocMarker, InsertBefore),
2724 ReservedSpace(NumReservedValues) {
2746 const Twine &NameStr =
"",
2748 return new (AllocMarker)
2749 PHINode(Ty, NumReservedValues, NameStr, InsertBefore);
2789 assert(V &&
"PHI node got a null value!");
2791 "All operands to PHI node must be the same type as the PHI node!");
2813 assert(
this == U.getUser() &&
"Iterator doesn't point to PHI's Uses?");
2837 assert(New && Old &&
"PHI node got a null basic block!");
2862 bool DeletePHIIfEmpty =
true);
2866 assert(Idx >= 0 &&
"Invalid basic block argument to remove!");
2873 bool DeletePHIIfEmpty =
true);
2887 assert(Idx >= 0 &&
"Invalid basic block argument!");
2893 assert(BB &&
"PHI node got a null basic block!");
2901 assert(Found &&
"Invalid basic block argument to set!");
2911 LLVM_ABI bool hasConstantOrUndefValue()
const;
2924 return I->getOpcode() == Instruction::PHI;
2957 unsigned ReservedSpace;
2959 LandingPadInst(
const LandingPadInst &LP);
2969 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
2972 void init(
unsigned NumReservedValues,
const Twine &NameStr);
2981 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
2986 unsigned NumReservedClauses,
2987 const Twine &NameStr =
"",
3029 return I->getOpcode() == Instruction::LandingPad;
3080 return new (AllocMarker) ReturnInst(
C, retVal, AllocMarker, InsertBefore);
3085 return new (AllocMarker) ReturnInst(
C,
nullptr, AllocMarker, InsertAtEnd);
3107 return (
I->getOpcode() == Instruction::Ret);
3114 BasicBlock *getSuccessor(
unsigned idx)
const {
3118 void setSuccessor(
unsigned idx, BasicBlock *
B) {
3135class LLVM_DEPRECATED(
"Use UncondBrInst/CondBrInst/Instruction instead",
"")
3143 LLVM_DEPRECATED(
"Use UncondBrInst::Create instead",
"UncondBrInst::Create")
3144 static
BranchInst *Create(BasicBlock *IfTrue,
3145 InsertPosition InsertBefore =
nullptr);
3147 LLVM_DEPRECATED(
"Use CondBrInst::Create instead",
"CondBrInst::Create")
3148 static
BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse,
3149 Value *
Cond, InsertPosition InsertBefore =
nullptr);
3156 bool isUnconditional()
const;
3158 bool isConditional()
const;
3171 void swapSuccessors();
3174 static
bool classof(
const Instruction *
I) {
3175 return (
I->getOpcode() == Instruction::UncondBr ||
3176 I->getOpcode() == Instruction::CondBr);
3178 static bool classof(
const Value *V) {
3199 constexpr static IntrusiveOperandsAllocMarker AllocMarker{1};
3201 UncondBrInst(
const UncondBrInst &BI);
3214 return new (AllocMarker) UncondBrInst(
Target, InsertBefore);
3222 using BranchInst::getCondition;
3223 using BranchInst::isConditional;
3224 using BranchInst::isUnconditional;
3225 using BranchInst::setCondition;
3226 using BranchInst::swapSuccessors;
3232 assert(i == 0 &&
"Successor # out of range for Branch!");
3238 assert(idx == 0 &&
"Successor # out of range for Branch!");
3253 return (
I->getOpcode() == Instruction::UncondBr);
3274 constexpr static IntrusiveOperandsAllocMarker AllocMarker{3};
3276 CondBrInst(
const CondBrInst &BI);
3290 using BranchInst::isConditional;
3291 using BranchInst::isUnconditional;
3297 return new (AllocMarker) CondBrInst(
Cond, IfTrue, IfFalse, InsertBefore);
3315 *(&
Op<-2>() + idx) = NewSucc;
3337 return (
I->getOpcode() == Instruction::CondBr);
3359inline BranchInst *BranchInst::Create(BasicBlock *IfTrue, BasicBlock *IfFalse,
3361 InsertPosition InsertBefore) {
3365inline bool BranchInst::isConditional()
const {
return isa<CondBrInst>(
this); }
3366inline bool BranchInst::isUnconditional()
const {
3370inline Value *BranchInst::getCondition()
const {
3373inline void BranchInst::setCondition(
Value *V) {
3377inline void BranchInst::swapSuccessors() {
3394 unsigned ReservedSpace;
3400 SwitchInst(
const SwitchInst &
SI);
3410 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
3413 void growOperands();
3433 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
3445 template <
typename SwitchInstT,
typename ConstantIntT,
typename BasicBlockT>
3465 "Index out the number of cases.");
3466 return SI->case_values()[
Index];
3473 "Index out the number of cases.");
3484 "Index out the number of cases.");
3489 assert(
SI ==
RHS.SI &&
"Incompatible operators.");
3507 "Index out the number of cases.");
3517 template <
typename CaseHandleT>
3520 std::random_access_iterator_tag,
3521 const CaseHandleT> {
3522 using SwitchInstT =
typename CaseHandleT::SwitchInstType;
3538 unsigned SuccessorIndex) {
3540 "Successor index # out of range!");
3555 (
unsigned)(Case.Index +
N) <= Case.SI->getNumCases() &&
3556 "Case.Index out the number of cases.");
3564 (
unsigned)(Case.Index -
N) <= Case.SI->getNumCases() &&
3565 "Case.Index out the number of cases.");
3570 assert(Case.SI ==
RHS.Case.SI &&
"Incompatible operators.");
3571 return Case.Index -
RHS.Case.Index;
3574 return Case ==
RHS.Case;
3577 assert(Case.SI ==
RHS.Case.SI &&
"Incompatible operators.");
3578 return Case.Index <
RHS.Case.Index;
3589 return new SwitchInst(
Value,
Default, NumCases, InsertBefore);
3670 const_cast<const SwitchInst *
>(
this)->
findCaseValue(
C)->getCaseIndex());
3689 for (
auto Case :
cases()) {
3690 if (Case.getCaseSuccessor() != BB)
3696 CI = Case.getCaseValue();
3736 return I->getOpcode() == Instruction::Switch;
3747 std::optional<SmallVector<uint32_t, 8>> Weights;
3748 bool Changed =
false;
3762 if (Changed && Weights.has_value()) {
3763 if (Weights->size() >= 2) {
3771 SI.setMetadata(LLVMContext::MD_prof,
nullptr);
3813 unsigned ReservedSpace;
3817 IndirectBrInst(
const IndirectBrInst &IBI);
3827 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
3830 void growOperands();
3839 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
3843 return new IndirectBrInst(
Address, NumDests, InsertBefore);
3868 LLVM_ABI void removeDestination(
unsigned i);
3890 return I->getOpcode() == Instruction::IndirectBr;
3912 static constexpr int NumExtraOperands = 2;
3915 static constexpr int NormalDestOpEndIdx = -3;
3918 static constexpr int UnwindDestOpEndIdx = -2;
3935 static unsigned ComputeNumOperands(
unsigned NumArgs,
3936 size_t NumBundleInputs = 0) {
3939 return 1 + NumExtraOperands + NumArgs +
unsigned(NumBundleInputs);
3951 const Twine &NameStr,
3954 ComputeNumOperands(
unsigned(Args.size()))};
3955 return new (AllocMarker) InvokeInst(Ty, Func, IfNormal, IfException, Args,
3956 {}, AllocMarker, NameStr, InsertBefore);
3962 const Twine &NameStr =
"",
3964 IntrusiveOperandsAndDescriptorAllocMarker AllocMarker{
3965 ComputeNumOperands(Args.size(), CountBundleInputs(Bundles)),
3968 return new (AllocMarker)
3969 InvokeInst(Ty, Func, IfNormal, IfException, Args, Bundles, AllocMarker,
3970 NameStr, InsertBefore);
3975 const Twine &NameStr,
3977 return Create(Func.getFunctionType(), Func.getCallee(), IfNormal,
3978 IfException, Args, {}, NameStr, InsertBefore);
3984 const Twine &NameStr =
"",
3986 return Create(Func.getFunctionType(), Func.getCallee(), IfNormal,
3987 IfException, Args, Bundles, NameStr, InsertBefore);
3996 LLVM_ABI static InvokeInst *Create(InvokeInst *
II,
3998 InsertPosition InsertPt =
nullptr);
4019 assert(i < 2 &&
"Successor # out of range for invoke!");
4024 assert(i < 2 &&
"Successor # out of range for invoke!");
4047 return (
I->getOpcode() == Instruction::Invoke);
4056 template <
typename Bitfield>
4057 void setSubclassData(
typename Bitfield::Type
Value) {
4068 init(Ty, Func, IfNormal, IfException, Args, Bundles, NameStr);
4081 unsigned NumIndirectDests;
4097 const Twine &NameStr);
4100 static unsigned ComputeNumOperands(
int NumArgs,
int NumIndirectDests,
4101 int NumBundleInputs = 0) {
4104 return unsigned(2 + NumIndirectDests + NumArgs + NumBundleInputs);
4120 ComputeNumOperands(Args.size(), IndirectDests.
size())};
4121 return new (AllocMarker)
4122 CallBrInst(Ty, Func, DefaultDest, IndirectDests, Args, {}, AllocMarker,
4123 NameStr, InsertBefore);
4131 IntrusiveOperandsAndDescriptorAllocMarker AllocMarker{
4132 ComputeNumOperands(Args.size(), IndirectDests.
size(),
4136 return new (AllocMarker)
4137 CallBrInst(Ty, Func, DefaultDest, IndirectDests, Args, Bundles,
4138 AllocMarker, NameStr, InsertBefore);
4145 return Create(Func.getFunctionType(), Func.getCallee(), DefaultDest,
4146 IndirectDests, Args, NameStr, InsertBefore);
4153 const Twine &NameStr =
"",
4155 return Create(Func.getFunctionType(), Func.getCallee(), DefaultDest,
4156 IndirectDests, Args, Bundles, NameStr, InsertBefore);
4167 InsertPosition InsertBefore =
nullptr);
4196 return IndirectDests;
4207 "Successor # out of range for callbr!");
4213 "Successor # out of range for callbr!");
4230 return (
I->getOpcode() == Instruction::CallBr);
4239 template <
typename Bitfield>
4240 void setSubclassData(
typename Bitfield::Type
Value) {
4252 init(Ty, Func, DefaultDest, IndirectDests, Args, Bundles, NameStr);
4265 ResumeInst(
const ResumeInst &RI);
4278 return new (AllocMarker) ResumeInst(Exn, InsertBefore);
4291 return I->getOpcode() == Instruction::Resume;
4298 BasicBlock *getSuccessor(
unsigned idx)
const {
4302 void setSuccessor(
unsigned idx,
BasicBlock *NewSucc) {
4309 iterator_range<const_succ_iterator>
successors()
const {
4331 unsigned ReservedSpace;
4336 CatchSwitchInst(
const CatchSwitchInst &CSI);
4343 unsigned NumHandlers,
const Twine &NameStr,
4347 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
4349 void init(
Value *ParentPad,
BasicBlock *UnwindDest,
unsigned NumReserved);
4350 void growOperands(
unsigned Size);
4359 void operator delete(
void *Ptr) {
4360 return User::operator
delete(Ptr, AllocMarker);
4364 unsigned NumHandlers,
4365 const Twine &NameStr =
"",
4367 return new CatchSwitchInst(ParentPad, UnwindDest, NumHandlers, NameStr,
4402 static const BasicBlock *handler_helper(
const Value *V) {
4460 LLVM_ABI void removeHandler(handler_iterator HI);
4465 "Successor # out of range for catchswitch!");
4470 "Successor # out of range for catchswitch!");
4484 return I->getOpcode() == Instruction::CatchSwitch;
4499class CleanupPadInst : public FuncletPadInst {
4504 : FuncletPadInst(Instruction::CleanupPad, ParentPad, Args,
AllocInfo,
4505 NameStr, InsertBefore) {}
4509 const Twine &NameStr =
"",
4511 IntrusiveOperandsAllocMarker AllocMarker{
unsigned(1 + Args.size())};
4512 return new (AllocMarker)
4513 CleanupPadInst(ParentPad, Args, AllocMarker, NameStr, InsertBefore);
4518 return I->getOpcode() == Instruction::CleanupPad;
4528class CatchPadInst :
public FuncletPadInst {
4533 : FuncletPadInst(Instruction::CatchPad, CatchSwitch, Args,
AllocInfo,
4534 NameStr, InsertBefore) {}
4538 const Twine &NameStr =
"",
4541 return new (AllocMarker)
4542 CatchPadInst(CatchSwitch, Args, AllocMarker, NameStr, InsertBefore);
4551 Op<-1>() = CatchSwitch;
4556 return I->getOpcode() == Instruction::CatchPad;
4570 CatchReturnInst(
const CatchReturnInst &RI);
4587 return new (AllocMarker) CatchReturnInst(CatchPad, BB, InsertBefore);
4615 return (
I->getOpcode() == Instruction::CatchRet);
4635 iterator_range<const_succ_iterator>
successors()
const {
4677 return new (AllocMarker)
4678 CleanupReturnInst(CleanupPad, UnwindBB, AllocMarker, InsertBefore);
4693 Op<0>() = CleanupPad;
4709 return (
I->getOpcode() == Instruction::CleanupRet);
4716 BasicBlock *getSuccessor(
unsigned Idx)
const {
4718 return getUnwindDest();
4721 void setSuccessor(
unsigned Idx, BasicBlock *
B) {
4736 template <
typename Bitfield>
4737 void setSubclassData(
typename Bitfield::Type
Value) {
4771 void *
operator new(
size_t S) {
return User::operator
new(S, AllocMarker); }
4772 void operator delete(
void *Ptr) { User::operator
delete(Ptr, AllocMarker); }
4778 return I->getOpcode() == Instruction::Unreachable;
4785 LLVM_ABI bool shouldLowerToTrap(
bool TrapUnreachable,
4786 bool NoTrapAfterNoreturn)
const;
4789 BasicBlock *getSuccessor(
unsigned idx)
const {
4793 void setSuccessor(
unsigned idx, BasicBlock *
B) {
4825 const Twine &NameStr =
"",
4832 return I->getOpcode() == Trunc;
4861 unsigned NoWrapKind = 0;
4890 const Twine &NameStr =
"",
4897 return I->getOpcode() == ZExt;
4922 const Twine &NameStr =
"",
4929 return I->getOpcode() == SExt;
4953 const Twine &NameStr =
"",
4960 return I->getOpcode() == FPTrunc;
4985 const Twine &NameStr =
"",
4992 return I->getOpcode() == FPExt;
5017 const Twine &NameStr =
"",
5024 return I->getOpcode() == UIToFP;
5049 const Twine &NameStr =
"",
5056 return I->getOpcode() == SIToFP;
5081 const Twine &NameStr =
"",
5088 return I->getOpcode() == FPToUI;
5113 const Twine &NameStr =
"",
5120 return I->getOpcode() == FPToSI;
5141 const Twine &NameStr =
"",
5156 return I->getOpcode() == IntToPtr;
5181 const Twine &NameStr =
"",
5200 return I->getOpcode() == PtrToInt;
5222 const Twine &NameStr =
"",
5241 return I->getOpcode() == PtrToAddr;
5266 const Twine &NameStr =
"",
5273 return I->getOpcode() == BitCast;
5299 const Twine &NameStr =
"",
5306 return I->getOpcode() == AddrSpaceCast;
5346 return Load->getPointerOperand();
5348 return Store->getPointerOperand();
5352 return const_cast<Value *
>(
5362 return Gep->getPointerOperand();
5372 "Expected Load or Store instruction");
5374 return LI->getAlign();
5381 "Expected Load or Store instruction");
5383 LI->setAlignment(NewAlign);
5392 "Expected Load or Store instruction");
5394 return LI->getPointerAddressSpace();
5401 "Expected Load or Store instruction");
5403 return LI->getType();
5411 return std::nullopt;
5413 return AI->getSyncScopeID();
5415 return AI->getSyncScopeID();
5417 return AI->getSyncScopeID();
5419 return AI->getSyncScopeID();
5421 return AI->getSyncScopeID();
5429 AI->setSyncScopeID(SSID);
5431 AI->setSyncScopeID(SSID);
5433 AI->setSyncScopeID(SSID);
5435 AI->setSyncScopeID(SSID);
5437 AI->setSyncScopeID(SSID);
5462 return I->getOpcode() == Freeze;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool isReverseMask(ArrayRef< int > M, EVT VT)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Atomic ordering constants.
static const Function * getParent(const Value *V)
This file implements methods to test, set and extract typed bits from packed unsigned integers.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_DEPRECATED(MSG, FIX)
#define LLVM_SUPPRESS_DEPRECATED_DECLARATIONS_PUSH
#define LLVM_SUPPRESS_DEPRECATED_DECLARATIONS_POP
static Value * getCondition(Instruction *I)
static void setCondition(Instruction *I, Value *NewCond)
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
This defines the Use class.
const size_t AbstractManglingParser< Derived, Alloc >::NumOps
This file implements a map that provides insertion order iteration.
uint64_t IntrinsicInst * II
#define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS)
Macro for generating out-of-class operand accessor definitions.
#define DECLARE_TRANSPARENT_OPERAND_ACCESSORS(VALUECLASS)
Macro for generating in-class operand accessor declarations.
PowerPC Reduce CR logical Operation
This file contains the declarations for profiling metadata utility functions.
const SmallVectorImpl< MachineOperand > & Cond
This file defines the SmallVector class.
static SymbolRef::Type getType(const Symbol *Sym)
Class for arbitrary precision integers.
const Value * getPointerOperand() const
Gets the pointer operand.
LLVM_ABI AddrSpaceCastInst * cloneImpl() const
Clone an identical AddrSpaceCastInst.
Value * getPointerOperand()
Gets the pointer operand.
static bool classof(const Instruction *I)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
unsigned getSrcAddressSpace() const
Returns the address space of the pointer operand.
LLVM_ABI AddrSpaceCastInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
unsigned getDestAddressSpace() const
Returns the address space of the result.
static unsigned getPointerOperandIndex()
Gets the operand index of the pointer operand.
LLVM_ABI std::optional< TypeSize > getAllocationSizeInBits(const DataLayout &DL) const
Get allocation size in bits.
static bool classof(const Value *V)
bool isSwiftError() const
Return true if this alloca is used as a swifterror argument to a call.
void setSwiftError(bool V)
Specify whether this alloca is used to represent a swifterror.
LLVM_ABI bool isStaticAlloca() const
Return true if this alloca is in the entry block of the function and is a constant size.
Align getAlign() const
Return the alignment of the memory that is being allocated by the instruction.
void setAllocatedType(Type *Ty)
for use only in special circumstances that need to generically transform a whole instruction (eg: IR ...
static bool classof(const Instruction *I)
PointerType * getType() const
Overload to return most specific pointer type.
void setUsedWithInAlloca(bool V)
Specify whether this alloca is used to represent the arguments to a call.
LLVM_ABI AllocaInst * cloneImpl() const
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Type * getAllocatedType() const
Return the type that is being allocated by the instruction.
bool isUsedWithInAlloca() const
Return true if this alloca is used as an inalloca argument to a call.
unsigned getAddressSpace() const
Return the address space for the allocation.
LLVM_ABI std::optional< TypeSize > getAllocationSize(const DataLayout &DL) const
Get allocation size in bytes.
LLVM_ABI bool isArrayAllocation() const
Return true if there is an allocation size parameter to the allocation instruction that is not 1.
void setAlignment(Align Align)
const Value * getArraySize() const
Get the number of elements allocated.
LLVM_ABI AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize, const Twine &Name, InsertPosition InsertBefore)
Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
Get the array size.
An instruction that atomically checks whether a specified value is in a memory location,...
BoolBitfieldElementT< 0 > VolatileField
const Value * getCompareOperand() const
AlignmentBitfieldElementT< FailureOrderingField::NextBit > AlignmentField
Value * getNewValOperand()
void setSyncScopeID(SyncScope::ID SSID)
Sets the synchronization scope ID of this cmpxchg instruction.
AtomicOrdering getMergedOrdering() const
Returns a single ordering which is at least as strong as both the success and failure orderings for t...
void setWeak(bool IsWeak)
bool isVolatile() const
Return true if this is a cmpxchg from a volatile memory location.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
BoolBitfieldElementT< VolatileField::NextBit > WeakField
Value * getCompareOperand()
void setFailureOrdering(AtomicOrdering Ordering)
Sets the failure ordering constraint of this cmpxchg instruction.
AtomicOrderingBitfieldElementT< SuccessOrderingField::NextBit > FailureOrderingField
static bool isValidFailureOrdering(AtomicOrdering Ordering)
AtomicOrderingBitfieldElementT< WeakField::NextBit > SuccessOrderingField
AtomicOrdering getFailureOrdering() const
Returns the failure ordering constraint of this cmpxchg instruction.
void setSuccessOrdering(AtomicOrdering Ordering)
Sets the success ordering constraint of this cmpxchg instruction.
Value * getPointerOperand()
static AtomicOrdering getStrongestFailureOrdering(AtomicOrdering SuccessOrdering)
Returns the strongest permitted ordering on failure, given the desired ordering on success.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
LLVM_ABI AtomicCmpXchgInst * cloneImpl() const
Align getAlign() const
Return the alignment of the memory that is being allocated by the instruction.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
const Value * getPointerOperand() const
static bool classof(const Value *V)
bool isWeak() const
Return true if this cmpxchg may spuriously fail.
void setAlignment(Align Align)
void setVolatile(bool V)
Specify whether this is a volatile cmpxchg.
static bool isValidSuccessOrdering(AtomicOrdering Ordering)
AtomicOrdering getSuccessOrdering() const
Returns the success ordering constraint of this cmpxchg instruction.
static unsigned getPointerOperandIndex()
const Value * getNewValOperand() const
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID of this cmpxchg instruction.
LLVM_ABI AtomicCmpXchgInst(Value *Ptr, Value *Cmp, Value *NewVal, Align Alignment, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, SyncScope::ID SSID, InsertPosition InsertBefore=nullptr)
static bool classof(const Instruction *I)
an instruction that atomically reads a memory location, combines it with another value,...
bool isElementwise() const
Return true if this RMW has elementwise vector semantics.
Align getAlign() const
Return the alignment of the memory that is being allocated by the instruction.
static bool isFPOperation(BinOp Op)
LLVM_ABI AtomicRMWInst * cloneImpl() const
static unsigned getPointerOperandIndex()
bool isVolatile() const
Return true if this is a RMW on a volatile memory location.
void setVolatile(bool V)
Specify whether this is a volatile RMW or not.
LLVM_ABI AtomicRMWInst(BinOp Operation, Value *Ptr, Value *Val, Align Alignment, AtomicOrdering Ordering, SyncScope::ID SSID, bool Elementwise=false, InsertPosition InsertBefore=nullptr)
BinOpBitfieldElement< AtomicOrderingField::NextBit > OperationField
BinOp
This enumeration lists the possible modifications atomicrmw can make.
@ USubCond
Subtract only if no unsigned overflow.
@ FMinimum
*p = minimum(old, v) minimum matches the behavior of llvm.minimum.
@ Min
*p = old <signed v ? old : v
@ USubSat
*p = usub.sat(old, v) usub.sat matches the behavior of llvm.usub.sat.
@ FMaximum
*p = maximum(old, v) maximum matches the behavior of llvm.maximum.
@ UIncWrap
Increment one up to a maximum value.
@ Max
*p = old >signed v ? old : v
@ UMin
*p = old <unsigned v ? old : v
@ FMin
*p = minnum(old, v) minnum matches the behavior of llvm.minnum.
@ UMax
*p = old >unsigned v ? old : v
@ FMaximumNum
*p = maximumnum(old, v) maximumnum matches the behavior of llvm.maximumnum.
@ FMax
*p = maxnum(old, v) maxnum matches the behavior of llvm.maxnum.
@ UDecWrap
Decrement one until a minimum value or zero.
@ FMinimumNum
*p = minimumnum(old, v) minimumnum matches the behavior of llvm.minimumnum.
void setSyncScopeID(SyncScope::ID SSID)
Sets the synchronization scope ID of this rmw instruction.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
Value * getPointerOperand()
void setOrdering(AtomicOrdering Ordering)
Sets the ordering constraint of this rmw instruction.
bool isFloatingPointOperation() const
static bool classof(const Instruction *I)
const Value * getPointerOperand() const
void setOperation(BinOp Operation)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
BinOp getOperation() const
const Value * getValOperand() const
BoolBitfieldElementT< AlignmentField::NextBit > ElementwiseField
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID of this rmw instruction.
void setAlignment(Align Align)
void setElementwise(bool V)
Specify whether this RMW has elementwise vector semantics.
AtomicOrdering getOrdering() const
Returns the ordering constraint of this rmw instruction.
AlignmentBitfieldElementT< OperationField::NextBit > AlignmentField
BoolBitfieldElementT< 0 > VolatileField
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
AtomicOrderingBitfieldElementT< VolatileField::NextBit > AtomicOrderingField
LLVM Basic Block Representation.
static bool classof(const Instruction *I)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
LLVM_ABI BitCastInst * cloneImpl() const
Clone an identical BitCastInst.
LLVM_ABI BitCastInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
void addFnAttr(Attribute::AttrKind Kind)
Adds the attribute to the function.
bool hasFnAttr(Attribute::AttrKind Kind) const
Determine whether this call has the given attribute.
CallBase(AttributeList const &A, FunctionType *FT, ArgsTy &&... Args)
LLVM_ABI Intrinsic::ID getIntrinsicID() const
Returns the intrinsic ID of the intrinsic called or Intrinsic::not_intrinsic if the called function i...
static unsigned CountBundleInputs(ArrayRef< OperandBundleDef > Bundles)
Return the total number of values used in Bundles.
unsigned arg_size() const
unsigned getNumTotalBundleOperands() const
Return the total number operands (not operand bundles) used by every operand bundle in this OperandBu...
CallBr instruction, tracking function calls that may not return control but instead transfer it to a ...
static bool classof(const Value *V)
static CallBrInst * Create(FunctionType *Ty, Value *Func, BasicBlock *DefaultDest, ArrayRef< BasicBlock * > IndirectDests, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles={}, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
iterator_range< succ_iterator > successors()
static bool classof(const Instruction *I)
static CallBrInst * Create(FunctionCallee Func, BasicBlock *DefaultDest, ArrayRef< BasicBlock * > IndirectDests, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles={}, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
SmallVector< BasicBlock *, 16 > getIndirectDests() const
iterator_range< const_succ_iterator > successors() const
static CallBrInst * Create(FunctionCallee Func, BasicBlock *DefaultDest, ArrayRef< BasicBlock * > IndirectDests, ArrayRef< Value * > Args, const Twine &NameStr, InsertPosition InsertBefore=nullptr)
void setSuccessor(unsigned i, BasicBlock *NewSucc)
BasicBlock * getSuccessor(unsigned i) const
Value * getIndirectDestLabelUse(unsigned i) const
BasicBlock * getIndirectDest(unsigned i) const
friend class Instruction
Iterator for Instructions in a `BasicBlock.
void setDefaultDest(BasicBlock *B)
unsigned getNumSuccessors() const
void setIndirectDest(unsigned i, BasicBlock *B)
Value * getIndirectDestLabel(unsigned i) const
getIndirectDestLabel - Return the i-th indirect dest label.
BasicBlock * getDefaultDest() const
unsigned getNumIndirectDests() const
Return the number of callbr indirect dest labels.
static CallBrInst * Create(FunctionType *Ty, Value *Func, BasicBlock *DefaultDest, ArrayRef< BasicBlock * > IndirectDests, ArrayRef< Value * > Args, const Twine &NameStr, InsertPosition InsertBefore=nullptr)
LLVM_ABI CallBrInst * cloneImpl() const
This class represents a function call, abstracting a target machine's calling convention.
bool isNoTailCall() const
LLVM_ABI void updateProfWeight(uint64_t S, uint64_t T)
Updates profile metadata by scaling it by S / T.
static bool classof(const Value *V)
void setTailCallKind(TailCallKind TCK)
Bitfield::Element< TailCallKind, 0, 2, TCK_LAST > TailCallKindField
static CallInst * Create(FunctionType *Ty, Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles={}, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
static CallInst * Create(FunctionType *Ty, Value *Func, ArrayRef< Value * > Args, const Twine &NameStr, InsertPosition InsertBefore=nullptr)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
bool canReturnTwice() const
Return true if the call can return twice.
TailCallKind getTailCallKind() const
LLVM_ABI CallInst * cloneImpl() const
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
void setTailCall(bool IsTc=true)
bool isMustTailCall() const
static CallInst * Create(FunctionCallee Func, ArrayRef< Value * > Args, const Twine &NameStr, InsertPosition InsertBefore=nullptr)
static bool classof(const Instruction *I)
bool isNonContinuableTrap() const
Return true if the call is for a noreturn trap intrinsic.
static CallInst * Create(FunctionCallee Func, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
static CallInst * Create(FunctionCallee Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles={}, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
CastInst(Type *Ty, unsigned iType, Value *S, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics for subclasses.
CatchSwitchInst * getCatchSwitch() const
Convenience accessors.
void setCatchSwitch(Value *CatchSwitch)
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static CatchPadInst * Create(Value *CatchSwitch, ArrayRef< Value * > Args, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
static bool classof(const Value *V)
static bool classof(const Instruction *I)
BasicBlock * getSuccessor() const
CatchPadInst * getCatchPad() const
Convenience accessors.
void setSuccessor(BasicBlock *NewSucc)
static bool classof(const Value *V)
static CatchReturnInst * Create(Value *CatchPad, BasicBlock *BB, InsertPosition InsertBefore=nullptr)
unsigned getNumSuccessors() const
friend class Instruction
Iterator for Instructions in a `BasicBlock.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
void setCatchPad(CatchPadInst *CatchPad)
LLVM_ABI CatchReturnInst * cloneImpl() const
Value * getCatchSwitchParentPad() const
Get the parentPad of this catchret's catchpad's catchswitch.
void setUnwindDest(BasicBlock *UnwindDest)
static bool classof(const Instruction *I)
BasicBlock *(*)(Value *) DerefFnTy
const BasicBlock *(*)(const Value *) ConstDerefFnTy
unsigned getNumSuccessors() const
const_handler_iterator handler_begin() const
Returns an iterator that points to the first handler in the CatchSwitchInst.
mapped_iterator< const_op_iterator, ConstDerefFnTy > const_handler_iterator
LLVM_ABI CatchSwitchInst * cloneImpl() const
mapped_iterator< op_iterator, DerefFnTy > handler_iterator
unsigned getNumHandlers() const
return the number of 'handlers' in this catchswitch instruction, except the default handler
iterator_range< handler_iterator > handler_range
void setSuccessor(unsigned Idx, BasicBlock *NewSucc)
Value * getParentPad() const
iterator_range< const_handler_iterator > const_handler_range
iterator_range< succ_iterator > successors()
friend class Instruction
Iterator for Instructions in a `BasicBlock.
void setParentPad(Value *ParentPad)
bool unwindsToCaller() const
static bool classof(const Value *V)
iterator_range< const_succ_iterator > successors() const
handler_iterator handler_end()
Returns a read-only iterator that points one past the last handler in the CatchSwitchInst.
BasicBlock * getUnwindDest() const
BasicBlock * getSuccessor(unsigned Idx) const
const_handler_iterator handler_end() const
Returns an iterator that points one past the last handler in the CatchSwitchInst.
bool hasUnwindDest() const
handler_iterator handler_begin()
Returns an iterator that points to the first handler in CatchSwitchInst.
static CatchSwitchInst * Create(Value *ParentPad, BasicBlock *UnwindDest, unsigned NumHandlers, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
handler_range handlers()
iteration adapter for range-for loops.
const_handler_range handlers() const
iteration adapter for range-for loops.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
static bool classof(const Value *V)
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static CleanupPadInst * Create(Value *ParentPad, ArrayRef< Value * > Args={}, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
static bool classof(const Instruction *I)
CleanupPadInst * getCleanupPad() const
Convenience accessor.
unsigned getNumSuccessors() const
BasicBlock * getUnwindDest() const
bool unwindsToCaller() const
void setCleanupPad(CleanupPadInst *CleanupPad)
static bool classof(const Value *V)
void setUnwindDest(BasicBlock *NewDest)
static CleanupReturnInst * Create(Value *CleanupPad, BasicBlock *UnwindBB=nullptr, InsertPosition InsertBefore=nullptr)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
bool hasUnwindDest() const
LLVM_ABI CleanupReturnInst * cloneImpl() const
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
void setPredicate(Predicate P)
Set the predicate for this instruction to the specified value.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
@ FCMP_OEQ
0 0 0 1 True if ordered and equal
@ FCMP_TRUE
1 1 1 1 Always true (always folded)
@ ICMP_SLT
signed less than
@ ICMP_SLE
signed less or equal
@ ICMP_UGE
unsigned greater or equal
@ ICMP_UGT
unsigned greater than
@ ICMP_SGT
signed greater than
@ FCMP_ONE
0 1 1 0 True if ordered and operands are unequal
@ FCMP_UEQ
1 0 0 1 True if unordered or equal
@ ICMP_ULT
unsigned less than
@ FCMP_ORD
0 1 1 1 True if ordered (no nans)
@ ICMP_SGE
signed greater or equal
@ FCMP_UNE
1 1 1 0 True if unordered or not equal
@ ICMP_ULE
unsigned less or equal
@ FCMP_FALSE
0 0 0 0 Always false (always folded)
@ FCMP_UNO
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
static auto ICmpPredicates()
Returns the sequence of all ICmp predicates.
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
static auto FCmpPredicates()
Returns the sequence of all FCmp predicates.
Predicate getNonStrictPredicate() const
For example, SGT -> SGE, SLT -> SLE, ULT -> ULE, UGT -> UGE.
LLVM_ABI CmpInst(Type *ty, Instruction::OtherOps op, Predicate pred, Value *LHS, Value *RHS, const Twine &Name="", InsertPosition InsertBefore=nullptr)
bool isFPPredicate() const
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE,...
Predicate getPredicate() const
Return the predicate for this instruction.
static bool isIntPredicate(Predicate P)
An abstraction over a floating-point predicate, and a pack of an integer predicate with samesign info...
Conditional Branch instruction.
static CondBrInst * Create(Value *Cond, BasicBlock *IfTrue, BasicBlock *IfFalse, InsertPosition InsertBefore=nullptr)
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
LLVM_ABI CondBrInst * cloneImpl() const
static bool classof(const Instruction *I)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
void setCondition(Value *V)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
unsigned getNumSuccessors() const
static bool classof(const Value *V)
Value * getCondition() const
BasicBlock * getSuccessor(unsigned i) const
iterator_range< succ_iterator > successors()
iterator_range< const_succ_iterator > successors() const
This is the shared class of boolean and integer constants.
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
bool isRelational() const
FCmpInst(Predicate Pred, Value *LHS, Value *RHS, const Twine &NameStr="", Instruction *FlagsSource=nullptr)
Constructor with no-insertion semantics.
static bool classof(const Value *V)
bool isCommutative() const
static bool isCommutative(Predicate Pred)
static LLVM_ABI bool compare(const APFloat &LHS, const APFloat &RHS, FCmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
static bool isEquality(Predicate Pred)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static auto predicates()
Returns the sequence of all FCmp predicates.
LLVM_ABI FCmpInst * cloneImpl() const
Clone an identical FCmpInst.
void swapOperands()
Exchange the two operands to this instruction in such a way that it does not modify the semantics of ...
FCmpInst(InsertPosition InsertBefore, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insertion semantics.
static bool classof(const Value *V)
LLVM_ABI FPExtInst * cloneImpl() const
Clone an identical FPExtInst.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
LLVM_ABI FPExtInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
static bool classof(const Value *V)
LLVM_ABI FPToSIInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
LLVM_ABI FPToSIInst * cloneImpl() const
Clone an identical FPToSIInst.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V)
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
friend class Instruction
Iterator for Instructions in a `BasicBlock.
LLVM_ABI FPToUIInst * cloneImpl() const
Clone an identical FPToUIInst.
LLVM_ABI FPToUIInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
LLVM_ABI FPTruncInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
static bool classof(const Value *V)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
LLVM_ABI FPTruncInst * cloneImpl() const
Clone an identical FPTruncInst.
Provide fast-math flags storage, instructions that support fast-math flags should inherit from this c...
static bool classof(const Value *V)
LLVM_ABI FenceInst(LLVMContext &C, AtomicOrdering Ordering, SyncScope::ID SSID=SyncScope::System, InsertPosition InsertBefore=nullptr)
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID of this fence instruction.
void setSyncScopeID(SyncScope::ID SSID)
Sets the synchronization scope ID of this fence instruction.
LLVM_ABI FenceInst * cloneImpl() const
static bool classof(const Instruction *I)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
void setOrdering(AtomicOrdering Ordering)
Sets the ordering constraint of this fence instruction.
AtomicOrdering getOrdering() const
Returns the ordering constraint of this fence instruction.
static bool classof(const Value *V)
LLVM_ABI FreezeInst(Value *S, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
LLVM_ABI FreezeInst * cloneImpl() const
Clone an identical FreezeInst.
static bool classof(const Instruction *I)
friend class CatchPadInst
friend class Instruction
Iterator for Instructions in a `BasicBlock.
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
Class to represent function types.
Represents flags for the getelementptr instruction/expression.
static GEPNoWrapFlags inBounds()
an instruction for type-safe pointer arithmetic to access elements of arrays and structs
LLVM_ABI bool isInBounds() const
Determine whether the GEP has the inbounds flag.
LLVM_ABI bool hasNoUnsignedSignedWrap() const
Determine whether the GEP has the nusw flag.
static LLVM_ABI Type * getTypeAtIndex(Type *Ty, Value *Idx)
Return the type of the element at the given index of an indexable type.
Value * getPointerOperand()
LLVM_ABI bool hasAllZeroIndices() const
Return true if all of the indices of this GEP are zeros.
static Type * getGEPReturnType(Value *Ptr, ArrayRef< Value * > IdxList)
Returns the pointer type returned by the GEP instruction, which may be a vector of pointers.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
void setResultElementType(Type *Ty)
LLVM_ABI bool hasNoUnsignedWrap() const
Determine whether the GEP has the nuw flag.
LLVM_ABI bool hasAllConstantIndices() const
Return true if all of the indices of this GEP are constant integers.
unsigned getAddressSpace() const
Returns the address space of this instruction's pointer type.
iterator_range< const_op_iterator > indices() const
Type * getResultElementType() const
static bool classof(const Instruction *I)
static bool classof(const Value *V)
iterator_range< op_iterator > indices()
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
LLVM_ABI void setIsInBounds(bool b=true)
Set or clear the inbounds flag on this GEP instruction.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
void setSourceElementType(Type *Ty)
static LLVM_ABI Type * getIndexedType(Type *Ty, ArrayRef< Value * > IdxList)
Returns the result type of a getelementptr with the given source element type and indexes.
Type * getSourceElementType() const
static GetElementPtrInst * CreateInBounds(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Create an "inbounds" getelementptr.
Type * getPointerOperandType() const
Method to return the pointer operand as a PointerType.
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, GEPNoWrapFlags NW, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
static unsigned getPointerOperandIndex()
LLVM_ABI bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const
Accumulate the constant address offset of this GEP if possible.
const_op_iterator idx_begin() const
LLVM_ABI GetElementPtrInst * cloneImpl() const
LLVM_ABI bool collectOffset(const DataLayout &DL, unsigned BitWidth, SmallMapVector< Value *, APInt, 4 > &VariableOffsets, APInt &ConstantOffset) const
LLVM_ABI void setNoWrapFlags(GEPNoWrapFlags NW)
Set nowrap flags for GEP instruction.
unsigned getNumIndices() const
LLVM_ABI GEPNoWrapFlags getNoWrapFlags() const
Get the nowrap flags for the GEP instruction.
const_op_iterator idx_end() const
const Value * getPointerOperand() const
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
bool hasSameSign() const
An icmp instruction, which can be marked as "samesign", indicating that the two operands have the sam...
static bool classof(const Value *V)
void setSameSign(bool B=true)
ICmpInst(InsertPosition InsertBefore, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with insertion semantics.
static bool isCommutative(Predicate P)
static CmpPredicate getSwappedCmpPredicate(CmpPredicate Pred)
CmpPredicate getCmpPredicate() const
bool isCommutative() const
static bool isGE(Predicate P)
Return true if the predicate is SGE or UGE.
CmpPredicate getSwappedCmpPredicate() const
static bool isLT(Predicate P)
Return true if the predicate is SLT or ULT.
LLVM_ABI ICmpInst * cloneImpl() const
Clone an identical ICmpInst.
CmpPredicate getInverseCmpPredicate() const
Predicate getNonStrictCmpPredicate() const
For example, SGT -> SGE, SLT -> SLE, ULT -> ULE, UGT -> UGE.
static bool isGT(Predicate P)
Return true if the predicate is SGT or UGT.
static bool classof(const Instruction *I)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Predicate getFlippedSignednessPredicate() const
For example, SLT->ULT, ULT->SLT, SLE->ULE, ULE->SLE, EQ->EQ.
static CmpPredicate getNonStrictCmpPredicate(CmpPredicate Pred)
Predicate getSignedPredicate() const
For example, EQ->EQ, SLE->SLE, UGT->SGT, etc.
static CmpPredicate getInverseCmpPredicate(CmpPredicate Pred)
bool isEquality() const
Return true if this predicate is either EQ or NE.
static LLVM_ABI Predicate getFlippedSignednessPredicate(Predicate Pred)
For example, SLT->ULT, ULT->SLT, SLE->ULE, ULE->SLE, EQ->EQ.
static bool isEquality(Predicate P)
Return true if this predicate is either EQ or NE.
static bool isRelational(Predicate P)
Return true if the predicate is relational (not EQ or NE).
void swapOperands()
Exchange the two operands to this instruction in such a way that it does not modify the semantics of ...
static auto predicates()
Returns the sequence of all ICmp predicates.
ICmpInst(Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
Constructor with no-insertion semantics.
bool isRelational() const
Return true if the predicate is relational (not EQ or NE).
Predicate getUnsignedPredicate() const
For example, EQ->EQ, SLE->ULE, UGT->UGT, etc.
static bool isLE(Predicate P)
Return true if the predicate is SLE or ULE.
Indirect Branch Instruction.
static IndirectBrInst * Create(Value *Address, unsigned NumDests, InsertPosition InsertBefore=nullptr)
BasicBlock * getDestination(unsigned i)
Return the specified destination.
static bool classof(const Value *V)
const Value * getAddress() const
iterator_range< succ_iterator > successors()
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Instruction *I)
BasicBlock * getSuccessor(unsigned i) const
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
unsigned getNumDestinations() const
return the number of possible destinations in this indirectbr instruction.
iterator_range< const_succ_iterator > successors() const
const BasicBlock * getDestination(unsigned i) const
void setSuccessor(unsigned i, BasicBlock *NewSucc)
void setAddress(Value *V)
unsigned getNumSuccessors() const
LLVM_ABI IndirectBrInst * cloneImpl() const
This instruction inserts a single (scalar) element into a VectorType value.
LLVM_ABI InsertElementInst * cloneImpl() const
static bool classof(const Value *V)
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
VectorType * getType() const
Overload to return most specific vector type.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Instruction *I)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
This instruction inserts a struct field of array element value into an aggregate value.
Value * getInsertedValueOperand()
static bool classof(const Instruction *I)
static unsigned getAggregateOperandIndex()
Value * getAggregateOperand()
const unsigned * idx_iterator
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
unsigned getNumIndices() const
ArrayRef< unsigned > getIndices() const
iterator_range< idx_iterator > indices() const
static unsigned getInsertedValueOperandIndex()
LLVM_ABI InsertValueInst * cloneImpl() const
idx_iterator idx_end() const
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
const Value * getAggregateOperand() const
const Value * getInsertedValueOperand() const
idx_iterator idx_begin() const
BitfieldElement::Type getSubclassData() const
typename Bitfield::Element< unsigned, Offset, 6, Value::MaxAlignmentExponent > AlignmentBitfieldElementT
typename Bitfield::Element< AtomicOrdering, Offset, 3, AtomicOrdering::LAST > AtomicOrderingBitfieldElementT
LLVM_ABI void copyIRFlags(const Value *V, bool IncludeWrapFlags=true)
Convenience method to copy supported exact, fast-math, and (optionally) wrapping flags from V to this...
typename Bitfield::Element< bool, Offset, 1 > BoolBitfieldElementT
LLVM_ABI bool isAtomic() const LLVM_READONLY
Return true if this instruction has an AtomicOrdering of unordered or higher.
LLVM_ABI iterator_range< const_succ_iterator > successors() const LLVM_READONLY
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
LLVM_ABI void copyMetadata(const Instruction &SrcInst, ArrayRef< unsigned > WL=ArrayRef< unsigned >())
Copy metadata from SrcInst to this instruction.
friend class BasicBlock
Various leaf nodes.
void setSubclassData(typename BitfieldElement::Type Value)
static bool classof(const Instruction *I)
LLVM_ABI IntToPtrInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
LLVM_ABI IntToPtrInst * cloneImpl() const
Clone an identical IntToPtrInst.
unsigned getAddressSpace() const
Returns the address space of this instruction's pointer type.
static bool classof(const Value *V)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Instruction *I)
BasicBlock * getUnwindDest() const
void setNormalDest(BasicBlock *B)
LLVM_ABI InvokeInst * cloneImpl() const
static bool classof(const Value *V)
static InvokeInst * Create(FunctionCallee Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, InsertPosition InsertBefore=nullptr)
void setSuccessor(unsigned i, BasicBlock *NewSucc)
static InvokeInst * Create(FunctionCallee Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles={}, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
iterator_range< const_succ_iterator > successors() const
BasicBlock * getSuccessor(unsigned i) const
void setUnwindDest(BasicBlock *B)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
iterator_range< succ_iterator > successors()
BasicBlock * getNormalDest() const
static InvokeInst * Create(FunctionType *Ty, Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles={}, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
unsigned getNumSuccessors() const
static InvokeInst * Create(FunctionType *Ty, Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, InsertPosition InsertBefore=nullptr)
This is an important class for using LLVM in a threaded context.
The landingpad instruction holds all of the information necessary to generate correct exception handl...
bool isCleanup() const
Return 'true' if this landingpad instruction is a cleanup.
LLVM_ABI LandingPadInst * cloneImpl() const
unsigned getNumClauses() const
Get the number of clauses for this landing pad.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
bool isCatch(unsigned Idx) const
Return 'true' if the clause and index Idx is a catch clause.
bool isFilter(unsigned Idx) const
Return 'true' if the clause and index Idx is a filter clause.
Constant * getClause(unsigned Idx) const
Get the value of the clause at index Idx.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
void setCleanup(bool V)
Indicate that this landingpad instruction is a cleanup.
void reserveClauses(unsigned Size)
Grow the size of the operand list to accommodate the new number of clauses.
static bool classof(const Instruction *I)
void setElementwise(bool V)
Specify whether this is an elementwise atomic load or not.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
const Value * getPointerOperand() const
void setAlignment(Align Align)
Value * getPointerOperand()
bool isVolatile() const
Return true if this is a load from a volatile memory location.
static bool classof(const Instruction *I)
void setOrdering(AtomicOrdering Ordering)
Sets the ordering constraint of this load instruction.
static bool classof(const Value *V)
void setSyncScopeID(SyncScope::ID SSID)
Sets the synchronization scope ID of this load instruction.
void setAtomic(AtomicOrdering Ordering, SyncScope::ID SSID=SyncScope::System)
Sets the ordering constraint and the synchronization scope ID of this load instruction.
LLVM_ABI LoadInst * cloneImpl() const
friend class Instruction
Iterator for Instructions in a `BasicBlock.
AtomicOrdering getOrdering() const
Returns the ordering constraint of this load instruction.
Type * getPointerOperandType() const
void setProperties(const LoadStoreInstProperties &Props)
Sets the properties of this load instruction.
static unsigned getPointerOperandIndex()
void setVolatile(bool V)
Specify whether this is a volatile load or not.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID of this load instruction.
LoadStoreInstProperties getProperties() const
Returns the properties of this load instruction.
bool isElementwise() const
Return true if this is an elementwise atomic load.
LLVM_ABI LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, InsertPosition InsertBefore)
Align getAlign() const
Return the alignment of the access that is being performed.
Represent a mutable reference to an array (0 or more elements consecutively in memory),...
BasicBlock * getIncomingBlock(Value::const_user_iterator I) const
Return incoming basic block corresponding to value use iterator.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
void addIncoming(Value *V, BasicBlock *BB)
Add an incoming value to the end of the PHI list.
bool isComplete() const
If the PHI node is complete which means all of its parent's predecessors have incoming value in this ...
iterator_range< const_block_iterator > blocks() const
op_range incoming_values()
static bool classof(const Value *V)
void allocHungoffUses(unsigned N)
const_block_iterator block_begin() const
void setIncomingValueForBlock(const BasicBlock *BB, Value *V)
Set every incoming value(s) for block BB to V.
BasicBlock ** block_iterator
void setIncomingBlock(unsigned i, BasicBlock *BB)
LLVM_ABI Value * removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty=true)
Remove an incoming value.
BasicBlock *const * const_block_iterator
friend class Instruction
Iterator for Instructions in a `BasicBlock.
void setIncomingValue(unsigned i, Value *V)
static unsigned getOperandNumForIncomingValue(unsigned i)
void copyIncomingBlocks(iterator_range< const_block_iterator > BBRange, uint32_t ToIdx=0)
Copies the basic blocks from BBRange to the incoming basic block list of this PHINode,...
const_block_iterator block_end() const
Value * getIncomingValueForBlock(const BasicBlock *BB) const
BasicBlock * getIncomingBlock(unsigned i) const
Return incoming basic block number i.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
Value * getIncomingValue(unsigned i) const
Return incoming value number x.
static unsigned getIncomingValueNumForOperand(unsigned i)
const_op_range incoming_values() const
Value * removeIncomingValue(const BasicBlock *BB, bool DeletePHIIfEmpty=true)
LLVM_ABI PHINode * cloneImpl() const
void replaceIncomingBlockWith(const BasicBlock *Old, BasicBlock *New)
Replace every incoming basic block Old to basic block New.
BasicBlock * getIncomingBlock(const Use &U) const
Return incoming basic block corresponding to an operand of the PHI.
int getBasicBlockIndex(const BasicBlock *BB) const
Return the first index of the specified basic block in the value list for this PHI.
unsigned getNumIncomingValues() const
Return the number of incoming edges.
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will h...
Class to represent pointers.
unsigned getAddressSpace() const
Return the address space of the Pointer type.
LLVM_ABI PtrToAddrInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
static unsigned getPointerOperandIndex()
Gets the operand index of the pointer operand.
static bool classof(const Instruction *I)
LLVM_ABI PtrToAddrInst * cloneImpl() const
Clone an identical PtrToAddrInst.
static bool classof(const Value *V)
const Value * getPointerOperand() const
Gets the pointer operand.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Value * getPointerOperand()
Gets the pointer operand.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
Value * getPointerOperand()
Gets the pointer operand.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
static bool classof(const Value *V)
const Value * getPointerOperand() const
Gets the pointer operand.
static unsigned getPointerOperandIndex()
Gets the operand index of the pointer operand.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Instruction *I)
LLVM_ABI PtrToIntInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
LLVM_ABI PtrToIntInst * cloneImpl() const
Clone an identical PtrToIntInst.
Resume the propagation of an exception.
static ResumeInst * Create(Value *Exn, InsertPosition InsertBefore=nullptr)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
Value * getValue() const
Convenience accessor.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
unsigned getNumSuccessors() const
LLVM_ABI ResumeInst * cloneImpl() const
static bool classof(const Instruction *I)
Return a value (possibly void), from a function.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
unsigned getNumSuccessors() const
static bool classof(const Value *V)
static bool classof(const Instruction *I)
static ReturnInst * Create(LLVMContext &C, BasicBlock *InsertAtEnd)
Value * getReturnValue() const
Convenience accessor. Returns null if there is no return value.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static ReturnInst * Create(LLVMContext &C, Value *retVal=nullptr, InsertPosition InsertBefore=nullptr)
iterator_range< succ_iterator > successors()
LLVM_ABI ReturnInst * cloneImpl() const
iterator_range< const_succ_iterator > successors() const
static bool classof(const Value *V)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
LLVM_ABI SExtInst * cloneImpl() const
Clone an identical SExtInst.
LLVM_ABI SExtInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
LLVM_ABI SIToFPInst * cloneImpl() const
Clone an identical SIToFPInst.
LLVM_ABI SIToFPInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
This class represents the LLVM 'select' instruction.
void setFalseValue(Value *V)
const Value * getFalseValue() const
void setTrueValue(Value *V)
OtherOps getOpcode() const
void swapValues()
Swap the true and false values of the select instruction.
const Value * getCondition() const
LLVM_ABI SelectInst * cloneImpl() const
friend class Instruction
Iterator for Instructions in a `BasicBlock.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
static LLVM_ABI const char * areInvalidOperands(Value *Cond, Value *True, Value *False)
Return a string if the specified operands are invalid for a select operation, otherwise return null.
static bool classof(const Value *V)
void setCondition(Value *V)
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", InsertPosition InsertBefore=nullptr, const Instruction *MDFrom=nullptr)
const Value * getTrueValue() const
static bool classof(const Instruction *I)
This instruction constructs a fixed permutation of two input vectors.
static bool classof(const Value *V)
static bool isInterleaveMask(ArrayRef< int > Mask, unsigned Factor, unsigned NumInputElts)
Constant * getShuffleMaskForBitcode() const
Return the mask for this instruction, for use in bitcode.
bool isSingleSource() const
Return true if this shuffle chooses elements from exactly one source vector without changing the leng...
static LLVM_ABI bool isZeroEltSplatMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses all elements with the same value as the first element of exa...
bool changesLength() const
Return true if this shuffle returns a vector with a different number of elements than its source vect...
bool isExtractSubvectorMask(int &Index) const
Return true if this shuffle mask is an extract subvector mask.
ArrayRef< int > getShuffleMask() const
static LLVM_ABI bool isSpliceMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is a splice mask, concatenating the two inputs together and then ext...
static bool isInsertSubvectorMask(const Constant *Mask, int NumSrcElts, int &NumSubElts, int &Index)
static bool isSingleSourceMask(const Constant *Mask, int NumSrcElts)
int getMaskValue(unsigned Elt) const
Return the shuffle mask value of this instruction for the given element index.
LLVM_ABI ShuffleVectorInst(Value *V1, Value *Mask, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
void getShuffleMask(SmallVectorImpl< int > &Result) const
Return the mask for this instruction as a vector of integers.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
static bool isDeInterleaveMaskOfFactor(ArrayRef< int > Mask, unsigned Factor)
static LLVM_ABI bool isSelectMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from its source vectors without lane crossings.
VectorType * getType() const
Overload to return most specific vector type.
bool isInsertSubvectorMask(int &NumSubElts, int &Index) const
Return true if this shuffle mask is an insert subvector mask.
bool increasesLength() const
Return true if this shuffle returns a vector with a greater number of elements than its source vector...
bool isZeroEltSplat() const
Return true if all elements of this shuffle are the same value as the first element of exactly one so...
static bool isExtractSubvectorMask(const Constant *Mask, int NumSrcElts, int &Index)
static LLVM_ABI bool isSingleSourceMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from exactly one source vector.
static LLVM_ABI void getShuffleMask(const Constant *Mask, SmallVectorImpl< int > &Result)
Convert the input shuffle mask operand to a vector of integers.
bool isSelect() const
Return true if this shuffle chooses elements from its source vectors without lane crossings and all o...
static LLVM_ABI bool isDeInterleaveMaskOfFactor(ArrayRef< int > Mask, unsigned Factor, unsigned &Index)
Check if the mask is a DE-interleave mask of the given factor Factor like: <Index,...
LLVM_ABI ShuffleVectorInst * cloneImpl() const
static LLVM_ABI bool isIdentityMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask chooses elements from exactly one source vector without lane crossin...
static bool isSpliceMask(const Constant *Mask, int NumSrcElts, int &Index)
static LLVM_ABI bool isExtractSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is an extract subvector mask.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
bool isTranspose() const
Return true if this shuffle transposes the elements of its inputs without changing the length of the ...
static void commuteShuffleMask(MutableArrayRef< int > Mask, unsigned InVecNumElts)
Change values in a shuffle permute mask assuming the two vector operands of length InVecNumElts have ...
static LLVM_ABI bool isTransposeMask(ArrayRef< int > Mask, int NumSrcElts)
Return true if this shuffle mask is a transpose mask.
bool isSplice(int &Index) const
Return true if this shuffle splices two inputs without changing the length of the vectors.
static bool isReverseMask(const Constant *Mask, int NumSrcElts)
static LLVM_ABI bool isInsertSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &NumSubElts, int &Index)
Return true if this shuffle mask is an insert subvector mask.
static bool isSelectMask(const Constant *Mask, int NumSrcElts)
static bool classof(const Instruction *I)
static bool isZeroEltSplatMask(const Constant *Mask, int NumSrcElts)
bool isIdentity() const
Return true if this shuffle chooses elements from exactly one source vector without lane crossings an...
static bool isReplicationMask(const Constant *Mask, int &ReplicationFactor, int &VF)
static LLVM_ABI bool isReplicationMask(ArrayRef< int > Mask, int &ReplicationFactor, int &VF)
Return true if this shuffle mask replicates each of the VF elements in a vector ReplicationFactor tim...
static bool isIdentityMask(const Constant *Mask, int NumSrcElts)
static bool isTransposeMask(const Constant *Mask, int NumSrcElts)
static LLVM_ABI bool isInterleaveMask(ArrayRef< int > Mask, unsigned Factor, unsigned NumInputElts, SmallVectorImpl< unsigned > &StartIndexes)
Return true if the mask interleaves one or more input vectors together.
bool isReverse() const
Return true if this shuffle swaps the order of elements from exactly one source vector.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An instruction for storing to memory.
static bool classof(const Instruction *I)
AtomicOrdering getOrdering() const
Returns the ordering constraint of this store instruction.
const Value * getPointerOperand() const
Type * getPointerOperandType() const
void setVolatile(bool V)
Specify whether this is a volatile store or not.
void setAlignment(Align Align)
const Value * getValueOperand() const
void setOrdering(AtomicOrdering Ordering)
Sets the ordering constraint of this store instruction.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Value * getValueOperand()
static bool classof(const Value *V)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
LoadStoreInstProperties getProperties() const
Returns the properties of this store instruction.
void setSyncScopeID(SyncScope::ID SSID)
Sets the synchronization scope ID of this store instruction.
LLVM_ABI StoreInst * cloneImpl() const
void setProperties(const LoadStoreInstProperties &Props)
Sets the properties of this store instruction.
LLVM_ABI StoreInst(Value *Val, Value *Ptr, InsertPosition InsertBefore)
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
static unsigned getPointerOperandIndex()
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID of this store instruction.
bool isVolatile() const
Return true if this is a store to a volatile memory location.
Value * getPointerOperand()
void setAtomic(AtomicOrdering Ordering, SyncScope::ID SSID=SyncScope::System)
Sets the ordering constraint and the synchronization scope ID of this store instruction.
Represent a constant reference to a string, i.e.
LLVM_ABI void setSuccessorWeight(unsigned idx, CaseWeightOpt W)
LLVM_ABI Instruction::InstListType::iterator eraseFromParent()
Delegate the call to the underlying SwitchInst::eraseFromParent() and mark this object to not touch t...
LLVM_ABI void addCase(ConstantInt *OnVal, BasicBlock *Dest, CaseWeightOpt W)
Delegate the call to the underlying SwitchInst::addCase() and set the specified branch weight for the...
SwitchInstProfUpdateWrapper(SwitchInst &SI)
~SwitchInstProfUpdateWrapper()
LLVM_ABI CaseWeightOpt getSuccessorWeight(unsigned idx)
LLVM_ABI void replaceDefaultDest(SwitchInst::CaseIt I)
Replace the default destination by given case.
std::optional< uint32_t > CaseWeightOpt
SwitchInst * operator->()
LLVM_ABI SwitchInst::CaseIt removeCase(SwitchInst::CaseIt I)
Delegate the call to the underlying SwitchInst::removeCase() and remove correspondent branch weight.
A handle to a particular switch case.
unsigned getCaseIndex() const
Returns number of current case.
unsigned getSuccessorIndex() const
Returns successor index for current case successor.
BasicBlockT * getCaseSuccessor() const
Resolves successor for current case.
CaseHandleImpl(SwitchInstT *SI, ptrdiff_t Index)
bool operator==(const CaseHandleImpl &RHS) const
ConstantIntT * getCaseValue() const
Resolves case value for current case.
SwitchInstT SwitchInstType
CaseHandle(SwitchInst *SI, ptrdiff_t Index)
void setValue(ConstantInt *V) const
Sets the new value for current case.
void setSuccessor(BasicBlock *S) const
Sets the new successor for current case.
const CaseHandleT & operator*() const
CaseIteratorImpl()=default
Default constructed iterator is in an invalid state until assigned to a case for a particular switch.
CaseIteratorImpl & operator-=(ptrdiff_t N)
bool operator==(const CaseIteratorImpl &RHS) const
CaseIteratorImpl & operator+=(ptrdiff_t N)
ptrdiff_t operator-(const CaseIteratorImpl &RHS) const
bool operator<(const CaseIteratorImpl &RHS) const
CaseIteratorImpl(SwitchInstT *SI, unsigned CaseNum)
Initializes case iterator for given SwitchInst and for given case number.
static CaseIteratorImpl fromSuccessorIndex(SwitchInstT *SI, unsigned SuccessorIndex)
Initializes case iterator for given SwitchInst and for given successor index.
BasicBlock * getDefaultDest() const
void allocHungoffUses(unsigned N)
CaseIteratorImpl< ConstCaseHandle > ConstCaseIt
CaseIt case_end()
Returns a read/write iterator that points one past the last in the SwitchInst.
LLVM_ABI SwitchInst * cloneImpl() const
BasicBlock * getSuccessor(unsigned idx) const
ConstCaseIt findCaseValue(const ConstantInt *C) const
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
static SwitchInst * Create(Value *Value, BasicBlock *Default, unsigned NumCases, InsertPosition InsertBefore=nullptr)
void setCondition(Value *V)
bool defaultDestUnreachable() const
Returns true if the default branch must result in immediate undefined behavior, false otherwise.
ConstCaseIt case_begin() const
Returns a read-only iterator that points to the first case in the SwitchInst.
iterator_range< ConstCaseIt > cases() const
Constant iteration adapter for range-for loops.
static const unsigned DefaultPseudoIndex
LLVM_ABI void addCase(ConstantInt *OnVal, BasicBlock *Dest)
Add an entry to the switch instruction.
iterator_range< succ_iterator > successors()
CaseIteratorImpl< CaseHandle > CaseIt
ConstantInt * findCaseDest(BasicBlock *BB)
Finds the unique case value for a given successor.
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
CaseHandleImpl< const SwitchInst, const ConstantInt, const BasicBlock > ConstCaseHandle
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
unsigned getNumSuccessors() const
CaseIt case_default()
Returns an iterator that points to the default case.
void setDefaultDest(BasicBlock *DefaultCase)
ConstantInt *const * case_values() const
unsigned getNumCases() const
Return the number of 'cases' in this switch instruction, excluding the default case.
CaseIt findCaseValue(const ConstantInt *C)
Search all of the case values for the specified constant.
Value * getCondition() const
iterator_range< const_succ_iterator > successors() const
ConstCaseIt case_default() const
CaseIt case_begin()
Returns a read/write iterator that points to the first case in the SwitchInst.
static bool classof(const Instruction *I)
iterator_range< CaseIt > cases()
Iteration adapter for range-for loops.
ConstantInt ** case_values()
ConstCaseIt case_end() const
Returns a read-only iterator that points one past the last in the SwitchInst.
LLVM_ABI CaseIt removeCase(CaseIt I)
This method removes the specified case and its successor from the switch instruction.
Target - Wrapper for Target specific information.
void setHasNoSignedWrap(bool B)
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
LLVM_ABI TruncInst * cloneImpl() const
Clone an identical TruncInst.
void setHasNoUnsignedWrap(bool B)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
unsigned getNoWrapKind() const
Returns the no-wrap kind of the operation.
bool hasNoSignedWrap() const
Test whether this operation is known to never undergo signed overflow, aka the nsw property.
static bool classof(const Value *V)
LLVM_ABI TruncInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
bool hasNoUnsignedWrap() const
Test whether this operation is known to never undergo unsigned overflow, aka the nuw property.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM_ABI unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
static bool classof(const Value *V)
LLVM_ABI UIToFPInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
LLVM_ABI UIToFPInst * cloneImpl() const
Clone an identical UIToFPInst.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
UnaryInstruction(Type *Ty, unsigned iType, Value *V, InsertPosition InsertBefore=nullptr)
Unconditional Branch instruction.
void setSuccessor(unsigned idx, BasicBlock *NewSucc)
iterator_range< succ_iterator > successors()
static bool classof(const Value *V)
static bool classof(const Instruction *I)
void setSuccessor(BasicBlock *NewSucc)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static UncondBrInst * Create(BasicBlock *Target, InsertPosition InsertBefore=nullptr)
BasicBlock * getSuccessor(unsigned i=0) const
iterator_range< const_succ_iterator > successors() const
LLVM_ABI UncondBrInst * cloneImpl() const
unsigned getNumSuccessors() const
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
This function has undefined behavior.
LLVM_ABI UnreachableInst(LLVMContext &C, InsertPosition InsertBefore=nullptr)
unsigned getNumSuccessors() const
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
static bool classof(const Instruction *I)
LLVM_ABI UnreachableInst * cloneImpl() const
A Use represents the edge between a Value definition and its users.
iterator_range< const_op_iterator > const_op_range
const Use * getOperandList() const
LLVM_ABI void allocHungoffUses(unsigned N, bool WithExtraValues=false)
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.
const Use & getOperandUse(unsigned i) const
void setOperand(unsigned i, Value *Val)
const Use * const_op_iterator
void setNumHungOffUseOperands(unsigned NumOps)
Subclasses with hung off uses need to manage the operand count themselves.
iterator_range< op_iterator > op_range
Value * getOperand(unsigned i) const
unsigned getNumOperands() const
static bool classof(const Instruction *I)
Value * getPointerOperand()
VAArgInst(Value *List, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
const Value * getPointerOperand() const
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
static unsigned getPointerOperandIndex()
LLVM_ABI VAArgInst * cloneImpl() const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
user_iterator_impl< const User > const_user_iterator
unsigned char SubclassOptionalData
Hold arbitary subclass data.
LLVM_ABI void setName(const Twine &Name)
Change the name of the value.
Base class of all SIMD vector types.
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
LLVM_ABI ZExtInst(Value *S, Type *Ty, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
static bool classof(const Value *V)
LLVM_ABI ZExtInst * cloneImpl() const
Clone an identical ZExtInst.
An efficient, type-erasing, non-owning reference to a callable.
typename base_list_type::iterator iterator
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
A range adaptor for a pair of iterators.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
@ C
The default llvm calling convention, compatible with C.
@ System
Synchronized with respect to all concurrently executing threads.
This is an optimization pass for GlobalISel generic memory operations.
Type * checkGEPType(Type *Ty)
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
unsigned getLoadStoreAddressSpace(const Value *I)
A helper function that returns the address space of the pointer operand of load or store instruction.
RelativeUniformCounterPtr Values
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
auto successors(const MachineBasicBlock *BB)
const Value * getLoadStorePointerOperand(const Value *V)
A helper function that returns the pointer operand of a load or store instruction.
@ Load
The value being inserted comes from a load (InsertElement only).
@ Store
The extracted value is stored (ExtractElement only).
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
auto cast_or_null(const Y &Val)
void setAtomicSyncScopeID(Instruction *I, SyncScope::ID SSID)
A helper function that sets an atomic operation's sync scope.
Align getLoadStoreAlignment(const Value *I)
A helper function that returns the alignment of load or store instruction.
const Value * getPointerOperand(const Value *V)
A helper function that returns the pointer operand of a load, store or GEP instruction.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ABI void setBranchWeights(Instruction &I, ArrayRef< uint32_t > Weights, bool IsExpected, bool ElideAllZero=false)
Create a new branch_weights metadata node and add or overwrite a prof metadata reference to instructi...
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
std::optional< SyncScope::ID > getAtomicSyncScopeID(const Instruction *I)
A helper function that returns an atomic operation's sync scope; returns std::nullopt if it is not an...
LLVM_DEPRECATED("Prefer calling the constructor of llvm::scope_exit directly.", "scope_exit") auto make_scope_exit(Callable &&F)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
constexpr int PoisonMaskElem
AtomicOrdering
Atomic ordering for LLVM's memory model.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
Instruction::succ_iterator succ_iterator
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
OutputIt copy(R &&Range, OutputIt Out)
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
auto predecessors(const MachineBasicBlock *BB)
Instruction::const_succ_iterator const_succ_iterator
Type * getLoadStoreType(const Value *I)
A helper function that returns the type of a load or store instruction.
void setLoadStoreAlignment(Value *I, Align NewAlign)
A helper function that set the alignment of load or store instruction.
unsigned Log2(Align A)
Returns the log2 of the alignment.
@ Default
The result value is uniform if and only if all operands are uniform.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Summary of memprof metadata on allocations.
Describes an element of a Bitfield.
static constexpr bool areContiguous()
FixedNumOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...
HungoffOperandTraits - determine the allocation regime of the Use array when it is not a prefix to th...
A structure representing the properties of a load or store instruction.
Compile-time customization of User operands.
A MapVector that performs no allocations if smaller than a certain size.
Information about how a User object was allocated, to be passed into the User constructor.
Indicates this User has operands "hung off" in another allocation.
Indicates this User has operands co-allocated.
VariadicOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...