23#ifndef LLVM_IR_INTRINSICINST_H
24#define LLVM_IR_INTRINSICINST_H
75 case Intrinsic::maxnum:
76 case Intrinsic::minnum:
77 case Intrinsic::maximum:
78 case Intrinsic::minimum:
83 case Intrinsic::sadd_sat:
84 case Intrinsic::uadd_sat:
85 case Intrinsic::sadd_with_overflow:
86 case Intrinsic::uadd_with_overflow:
87 case Intrinsic::smul_with_overflow:
88 case Intrinsic::umul_with_overflow:
89 case Intrinsic::smul_fix:
90 case Intrinsic::umul_fix:
91 case Intrinsic::smul_fix_sat:
92 case Intrinsic::umul_fix_sat:
94 case Intrinsic::fmuladd:
105 case Intrinsic::assume:
106 case Intrinsic::sideeffect:
107 case Intrinsic::pseudoprobe:
108 case Intrinsic::dbg_assign:
109 case Intrinsic::dbg_declare:
110 case Intrinsic::dbg_value:
111 case Intrinsic::dbg_label:
112 case Intrinsic::invariant_start:
113 case Intrinsic::invariant_end:
114 case Intrinsic::lifetime_start:
115 case Intrinsic::lifetime_end:
116 case Intrinsic::experimental_noalias_scope_decl:
117 case Intrinsic::objectsize:
118 case Intrinsic::ptr_annotation:
119 case Intrinsic::var_annotation:
131 if (
const Function *CF =
I->getCalledFunction())
132 return CF->isIntrinsic();
136 return isa<CallInst>(V) &&
classof(cast<CallInst>(V));
143 case Intrinsic::lifetime_start:
144 case Intrinsic::lifetime_end:
160 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
168 case Intrinsic::dbg_declare:
169 case Intrinsic::dbg_value:
170 case Intrinsic::dbg_label:
171 case Intrinsic::dbg_assign:
187 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
197 std::bidirectional_iterator_tag, Value *> {
212 ? cast<ValueAsMetadata *>(
I)
213 : *cast<ValueAsMetadata **>(
I);
218 ? cast<ValueAsMetadata *>(
I)
219 : *cast<ValueAsMetadata **>(
I);
223 if (isa<ValueAsMetadata *>(
I))
224 I = cast<ValueAsMetadata *>(
I) + 1;
226 I = cast<ValueAsMetadata **>(
I) + 1;
230 if (isa<ValueAsMetadata *>(
I))
231 I = cast<ValueAsMetadata *>(
I) - 1;
233 I = cast<ValueAsMetadata **>(
I) - 1;
247 : RawLocation(RawLocation) {
249 assert(RawLocation &&
"unexpected null RawLocation");
250 assert(isa<ValueAsMetadata>(RawLocation) || isa<DIArgList>(RawLocation) ||
251 (isa<MDNode>(RawLocation) &&
252 !cast<MDNode>(RawLocation)->getNumOperands()));
281 return A.RawLocation ==
B.RawLocation;
289 return A.RawLocation >
B.RawLocation;
293 return A.RawLocation >=
B.RawLocation;
297 return A.RawLocation <
B.RawLocation;
301 return A.RawLocation <=
B.RawLocation;
316 bool AllowEmpty =
false);
350 if (!RemovedValues.
insert(OldValue).second)
370 return cast<MetadataAsValue>(
getArgOperand(0))->getMetadata();
378 return cast<MetadataAsValue>(
getArgOperand(1))->getMetadata();
382 return cast<MetadataAsValue>(
getArgOperand(2))->getMetadata();
411 return VariableSlice;
417 switch (
I->getIntrinsicID()) {
418 case Intrinsic::dbg_declare:
419 case Intrinsic::dbg_value:
420 case Intrinsic::dbg_assign:
427 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
442 "dbg.declare must have exactly 1 location operand.");
449 return I->getIntrinsicID() == Intrinsic::dbg_declare;
452 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
472 return I->getIntrinsicID() == Intrinsic::dbg_value ||
473 I->getIntrinsicID() == Intrinsic::dbg_assign;
476 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
495 return cast<MetadataAsValue>(
getArgOperand(OpAddress))->getMetadata();
498 return cast<MetadataAsValue>(
getArgOperand(OpAssignID))->getMetadata();
502 return cast<MetadataAsValue>(
getArgOperand(OpAddressExpr))->getMetadata();
524 return I->getIntrinsicID() == Intrinsic::dbg_assign;
527 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
541 return cast<MetadataAsValue>(
getArgOperand(0))->getMetadata();
547 return I->getIntrinsicID() == Intrinsic::dbg_label;
550 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
612 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
634 static std::optional<Intrinsic::ID>
638 static std::optional<Intrinsic::ID>
659 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
674 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
691 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
706 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
723 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
732 return getIntrinsicID() == Intrinsic::experimental_constrained_fcmps;
737 switch (
I->getIntrinsicID()) {
738 case Intrinsic::experimental_constrained_fcmp:
739 case Intrinsic::experimental_constrained_fcmps:
746 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
754 switch (
I->getIntrinsicID()) {
755 case Intrinsic::umin:
756 case Intrinsic::umax:
757 case Intrinsic::smin:
758 case Intrinsic::smax:
765 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
774 case Intrinsic::umin:
776 case Intrinsic::umax:
778 case Intrinsic::smin:
780 case Intrinsic::smax:
805 case Intrinsic::umin:
807 case Intrinsic::umax:
809 case Intrinsic::smin:
811 case Intrinsic::smax:
845 switch (
I->getIntrinsicID()) {
846 case Intrinsic::scmp:
847 case Intrinsic::ucmp:
854 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
883 switch (
I->getIntrinsicID()) {
884 case Intrinsic::uadd_with_overflow:
885 case Intrinsic::sadd_with_overflow:
886 case Intrinsic::usub_with_overflow:
887 case Intrinsic::ssub_with_overflow:
888 case Intrinsic::umul_with_overflow:
889 case Intrinsic::smul_with_overflow:
890 case Intrinsic::uadd_sat:
891 case Intrinsic::sadd_sat:
892 case Intrinsic::usub_sat:
893 case Intrinsic::ssub_sat:
900 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
920 switch (
I->getIntrinsicID()) {
921 case Intrinsic::uadd_with_overflow:
922 case Intrinsic::sadd_with_overflow:
923 case Intrinsic::usub_with_overflow:
924 case Intrinsic::ssub_with_overflow:
925 case Intrinsic::umul_with_overflow:
926 case Intrinsic::smul_with_overflow:
933 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
941 switch (
I->getIntrinsicID()) {
942 case Intrinsic::uadd_sat:
943 case Intrinsic::sadd_sat:
944 case Intrinsic::usub_sat:
945 case Intrinsic::ssub_sat:
952 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
962 enum { ARG_DEST = 0, ARG_LENGTH = 2 };
999 "setDest called with pointer of wrong type!");
1017 "setLength called with value of wrong type!");
1026 enum { ARG_SOURCE = 1 };
1031 return const_cast<Value *
>(BaseCL::getArgOperand(ARG_SOURCE));
1034 return BaseCL::getArgOperandUse(ARG_SOURCE);
1051 if (
auto MA = BaseCL::getParamAlign(ARG_SOURCE))
1057 return BaseCL::getParamAlign(ARG_SOURCE);
1062 "setSource called with pointer of wrong type!");
1063 BaseCL::setArgOperand(ARG_SOURCE,
Ptr);
1067 BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
1070 BaseCL::getContext(), *Alignment));
1074 BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
1076 BaseCL::getContext(), Alignment));
1084 enum { ARG_VALUE = 1 };
1088 return const_cast<Value *
>(BaseCL::getArgOperand(ARG_VALUE));
1095 "setValue called with value of wrong type!");
1096 BaseCL::setArgOperand(ARG_VALUE, Val);
1104 enum { ARG_ELEMENTSIZE = 3 };
1121 "setElementSizeInBytes called with value of wrong type!");
1126 switch (
I->getIntrinsicID()) {
1127 case Intrinsic::memcpy_element_unordered_atomic:
1128 case Intrinsic::memmove_element_unordered_atomic:
1129 case Intrinsic::memset_element_unordered_atomic:
1136 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1145 return I->getIntrinsicID() == Intrinsic::memset_element_unordered_atomic;
1148 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1157 switch (
I->getIntrinsicID()) {
1158 case Intrinsic::memcpy_element_unordered_atomic:
1159 case Intrinsic::memmove_element_unordered_atomic:
1166 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1175 return I->getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic;
1178 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1187 return I->getIntrinsicID() == Intrinsic::memmove_element_unordered_atomic;
1190 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1197 enum { ARG_VOLATILE = 3 };
1210 switch (
I->getIntrinsicID()) {
1211 case Intrinsic::memcpy:
1212 case Intrinsic::memmove:
1213 case Intrinsic::memset:
1214 case Intrinsic::memset_inline:
1215 case Intrinsic::memcpy_inline:
1222 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1231 switch (
I->getIntrinsicID()) {
1232 case Intrinsic::memset:
1233 case Intrinsic::memset_inline:
1240 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1249 return I->getIntrinsicID() == Intrinsic::memset_inline;
1252 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1261 switch (
I->getIntrinsicID()) {
1262 case Intrinsic::memcpy:
1263 case Intrinsic::memmove:
1264 case Intrinsic::memcpy_inline:
1271 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1280 return I->getIntrinsicID() == Intrinsic::memcpy ||
1281 I->getIntrinsicID() == Intrinsic::memcpy_inline;
1284 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1293 return I->getIntrinsicID() == Intrinsic::memmove;
1296 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1305 return I->getIntrinsicID() == Intrinsic::memcpy_inline;
1308 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1320 if (
auto *
MI = dyn_cast<MemIntrinsic>(
this))
1321 return MI->isVolatile();
1326 switch (
I->getIntrinsicID()) {
1327 case Intrinsic::memcpy:
1328 case Intrinsic::memcpy_inline:
1329 case Intrinsic::memmove:
1330 case Intrinsic::memset:
1331 case Intrinsic::memset_inline:
1332 case Intrinsic::memcpy_element_unordered_atomic:
1333 case Intrinsic::memmove_element_unordered_atomic:
1334 case Intrinsic::memset_element_unordered_atomic:
1341 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1351 switch (
I->getIntrinsicID()) {
1352 case Intrinsic::memset:
1353 case Intrinsic::memset_inline:
1354 case Intrinsic::memset_element_unordered_atomic:
1361 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1371 switch (
I->getIntrinsicID()) {
1372 case Intrinsic::memcpy:
1373 case Intrinsic::memcpy_inline:
1374 case Intrinsic::memmove:
1375 case Intrinsic::memcpy_element_unordered_atomic:
1376 case Intrinsic::memmove_element_unordered_atomic:
1383 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1393 switch (
I->getIntrinsicID()) {
1394 case Intrinsic::memcpy:
1395 case Intrinsic::memcpy_inline:
1396 case Intrinsic::memcpy_element_unordered_atomic:
1403 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1413 switch (
I->getIntrinsicID()) {
1414 case Intrinsic::memmove:
1415 case Intrinsic::memmove_element_unordered_atomic:
1422 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1430 return I->getIntrinsicID() == Intrinsic::vastart;
1433 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1443 return I->getIntrinsicID() == Intrinsic::vaend;
1446 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1456 return I->getIntrinsicID() == Intrinsic::vacopy;
1459 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1470 switch (
I.getIntrinsicID()) {
1471 case Intrinsic::instrprof_cover:
1472 case Intrinsic::instrprof_increment:
1473 case Intrinsic::instrprof_increment_step:
1474 case Intrinsic::instrprof_callsite:
1475 case Intrinsic::instrprof_timestamp:
1476 case Intrinsic::instrprof_value_profile:
1482 switch (
I.getIntrinsicID()) {
1483 case Intrinsic::instrprof_mcdc_parameters:
1484 case Intrinsic::instrprof_mcdc_tvbitmap_update:
1492 if (
const auto *Instr = dyn_cast<IntrinsicInst>(V))
1498 return cast<GlobalVariable>(
1511 if (
const auto *Instr = dyn_cast<IntrinsicInst>(V))
1526 return I->getIntrinsicID() == Intrinsic::instrprof_cover;
1529 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1537 return I->getIntrinsicID() == Intrinsic::instrprof_increment ||
1538 I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
1541 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1550 return I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
1553 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1564 return I->getIntrinsicID() == Intrinsic::instrprof_callsite;
1567 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1576 return I->getIntrinsicID() == Intrinsic::instrprof_timestamp;
1579 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1587 return I->getIntrinsicID() == Intrinsic::instrprof_value_profile;
1590 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1614 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1634 return I->getIntrinsicID() == Intrinsic::instrprof_mcdc_parameters;
1637 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1645 return I->getIntrinsicID() == Intrinsic::instrprof_mcdc_tvbitmap_update;
1648 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1667 return I->getIntrinsicID() == Intrinsic::pseudoprobe;
1671 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1694 return I->getIntrinsicID() == Intrinsic::experimental_noalias_scope_decl;
1698 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1704 return cast<MDNode>(MV->getMetadata());
1718 return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate ||
1719 I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1723 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1731 return isa<LandingPadInst>(Token) || isa<InvokeInst>(Token);
1742 return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate;
1746 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1770 return I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1774 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1783 return I->getIntrinsicID() == Intrinsic::assume;
1786 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1792 switch (IntrinsicID) {
1795 case Intrinsic::experimental_convergence_anchor:
1796 case Intrinsic::experimental_convergence_entry:
1797 case Intrinsic::experimental_convergence_loop:
1810 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
1814 return getIntrinsicID() == Intrinsic::experimental_convergence_anchor;
1817 return getIntrinsicID() == Intrinsic::experimental_convergence_entry;
1820 return getIntrinsicID() == Intrinsic::experimental_convergence_loop;
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_DEPRECATED(MSG, FIX)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file contains the declarations of entities that describe floating point environment and related ...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static SymbolRef::Type getType(const Symbol *Sym)
Class for arbitrary precision integers.
static APInt getMaxValue(unsigned numBits)
Gets maximum unsigned value of APInt for specific bit width.
static APInt getSignedMaxValue(unsigned numBits)
Gets maximum signed value of APInt for a specific bit width.
static APInt getMinValue(unsigned numBits)
Gets minimum unsigned value of APInt for a specific bit width.
static APInt getSignedMinValue(unsigned numBits)
Gets minimum signed value of APInt for a specific bit width.
This class represents any memcpy intrinsic i.e.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This class represents any memmove intrinsic i.e.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This class represents any memset intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This represents the llvm.assume intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This class represents the atomic memcpy intrinsic i.e.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
ConstantInt * getElementSizeInBytesCst() const
static bool classof(const IntrinsicInst *I)
Value * getRawElementSizeInBytes() const
static bool classof(const Value *V)
void setElementSizeInBytes(Constant *V)
uint32_t getElementSizeInBytes() const
This class represents the atomic memmove intrinsic i.e.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This class represents atomic memset intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
static Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
This class represents an intrinsic that is based on a binary operation.
static bool classof(const Value *V)
unsigned getNoWrapKind() const
Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.
bool isSigned() const
Whether the intrinsic is signed or unsigned.
static bool classof(const IntrinsicInst *I)
Instruction::BinaryOps getBinaryOp() const
Returns the binary operation underlying the intrinsic.
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
MaybeAlign getParamAlign(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a call argument.
Value * getArgOperand(unsigned i) const
void setArgOperand(unsigned i, Value *v)
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
This class represents a function call, abstracting a target machine's calling convention.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
@ ICMP_SLT
signed less than
@ ICMP_UGT
unsigned greater than
@ ICMP_SGT
signed greater than
@ ICMP_ULT
unsigned less than
This class represents a ucmp/scmp intrinsic.
static CmpInst::Predicate getGTPredicate(Intrinsic::ID ID)
CmpInst::Predicate getLTPredicate() const
static CmpInst::Predicate getLTPredicate(Intrinsic::ID ID)
static bool classof(const IntrinsicInst *I)
static bool isSigned(Intrinsic::ID ID)
CmpInst::Predicate getGTPredicate() const
static bool classof(const Value *V)
This is the shared class of boolean and integer constants.
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
This is an important base class in LLVM.
static Constant * getIntegerValue(Type *Ty, const APInt &V)
Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value...
Constrained floating point compare intrinsics.
FCmpInst::Predicate getPredicate() const
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This is the common base class for constrained floating point intrinsics.
std::optional< fp::ExceptionBehavior > getExceptionBehavior() const
std::optional< RoundingMode > getRoundingMode() const
unsigned getNonMetadataArgCount() const
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
bool isDefaultFPEnvironment() const
Represents calls to the llvm.experimintal.convergence.* intrinsics.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static std::optional< FragmentInfo > getFragmentInfo(expr_op_iterator Start, expr_op_iterator End)
Retrieve the details of this fragment expression.
This represents the llvm.dbg.assign instruction.
DIAssignID * getAssignID() const
static bool classof(const Value *V)
void setAssignId(DIAssignID *New)
void setKillAddress()
Kill the address component.
bool isKillAddress() const
Check whether this kills the address component.
Metadata * getRawAddress() const
DIExpression * getAddressExpression() const
Value * getAddress() const
static bool classof(const IntrinsicInst *I)
Metadata * getRawAddressExpression() const
Metadata * getRawAssignID() const
void setAddress(Value *V)
void setAddressExpression(DIExpression *NewExpr)
This represents the llvm.dbg.declare instruction.
static bool classof(const Value *V)
Value * getAddress() const
static bool classof(const IntrinsicInst *I)
This is the common base class for debug info intrinsics.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This represents the llvm.dbg.label instruction.
Metadata * getRawLabel() const
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
DILabel * getLabel() const
static bool classof(const Value *V)
void setLabel(DILabel *NewLabel)
This represents the llvm.dbg.value instruction.
iterator_range< location_op_iterator > getValues() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Value * getValue(unsigned OpIdx=0) const
This is the common base class for debug info intrinsics for variables.
DIExpression::FragmentInfo getFragmentOrEntireVariable() const
Get the FragmentInfo for the variable if it exists, otherwise return a FragmentInfo that covers the e...
void setVariable(DILocalVariable *NewVar)
iterator_range< location_op_iterator > location_ops() const
Get the locations corresponding to the variable referenced by the debug info intrinsic.
void addVariableLocationOps(ArrayRef< Value * > NewValues, DIExpression *NewExpr)
Adding a new location operand will always result in this intrinsic using an ArgList,...
void setRawLocation(Metadata *Location)
Use of this should generally be avoided; instead, replaceVariableLocationOp and addVariableLocationOp...
void replaceVariableLocationOp(Value *OldValue, Value *NewValue, bool AllowEmpty=false)
Value * getVariableLocationOp(unsigned OpIdx) const
std::optional< DIExpression::FragmentInfo > getFragment() const
Get the FragmentInfo for the variable.
static bool classof(const Value *V)
void setExpression(DIExpression *NewExpr)
Metadata * getRawLocation() const
DILocalVariable * getVariable() const
unsigned getNumVariableLocationOps() const
bool isAddressOfVariable() const
Does this describe the address of a local variable.
void setOperand(unsigned i, Value *v)
Metadata * getRawVariable() const
static bool classof(const IntrinsicInst *I)
std::optional< uint64_t > getFragmentSizeInBits() const
Get the size (in bits) of the variable, or fragment of the variable that is described.
DIExpression * getExpression() const
void setArgOperand(unsigned i, Value *v)
Metadata * getRawExpression() const
RawLocationWrapper getWrappedLocation() const
bool isKillLocation() const
Class representing an expression and its matching format.
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
Common base class for representing values projected from a statepoint.
const Value * getStatepoint() const
The statepoint with which this gc.relocate is associated.
bool isTiedToInvoke() const
Return true if this relocate is tied to the invoke statepoint.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
Represents calls to the gc.relocate intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
Value * getBasePtr() const
unsigned getBasePtrIndex() const
The index into the associate statepoint's argument list which contains the base pointer of the pointe...
Value * getDerivedPtr() const
unsigned getDerivedPtrIndex() const
The index into the associate statepoint's argument list which contains the pointer whose relocation t...
Represents calls to the gc.result intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This represents the llvm.instrprof.callsite intrinsic.
Value * getCallee() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
A base class for all instrprof counter intrinsics.
static bool classof(const Value *V)
ConstantInt * getIndex() const
ConstantInt * getNumCounters() const
This represents the llvm.instrprof.cover intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This represents the llvm.instrprof.increment.step intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This represents the llvm.instrprof.increment intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
A base class for all instrprof intrinsics.
static bool classof(const Value *V)
GlobalVariable * getName() const
ConstantInt * getHash() const
static bool isCounterBase(const IntrinsicInst &I)
static bool isMCDCBitmapBase(const IntrinsicInst &I)
A base class for instrprof mcdc intrinsics that require global bitmap bytes.
ConstantInt * getNumBitmapBits() const
static bool classof(const IntrinsicInst *I)
auto getNumBitmapBytes() const
static bool classof(const Value *V)
This represents the llvm.instrprof.mcdc.parameters intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This represents the llvm.instrprof.mcdc.tvbitmap.update intrinsic.
Value * getMCDCCondBitmapAddr() const
ConstantInt * getBitmapIndex() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This represents the llvm.instrprof.timestamp intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This represents the llvm.instrprof.value.profile intrinsic.
ConstantInt * getIndex() const
Value * getTargetValue() const
static bool classof(const IntrinsicInst *I)
ConstantInt * getValueKind() const
static bool classof(const Value *V)
A wrapper class for inspecting calls to intrinsic functions.
bool isAssumeLikeIntrinsic() const
Checks if the intrinsic is an annotation.
static bool mayLowerToFunctionCall(Intrinsic::ID IID)
Check if the intrinsic might lower into a regular function call in the course of IR transformations.
IntrinsicInst(const IntrinsicInst &)=delete
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
bool isCommutative() const
Return true if swapping the first two arguments to the intrinsic produces the same result.
static bool classof(const Value *V)
IntrinsicInst & operator=(const IntrinsicInst &)=delete
static bool classof(const CallInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
bool isAssociative() const
This is the common base class for lifetime intrinsics.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
LLVMContext & getContext() const
This class wraps the llvm.memcpy.inline intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This class wraps the llvm.memcpy intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Common base class for all memory intrinsics.
const Use & getRawDestUse() const
Value * getLength() const
Value * getRawDest() const
void setDestAlignment(Align Alignment)
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions (including addrspacecast) that ...
void setDestAlignment(MaybeAlign Alignment)
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
unsigned getDestAlignment() const
FIXME: Remove this function once transition to Align is over.
MaybeAlign getDestAlign() const
const Use & getLengthUse() const
unsigned getDestAddressSpace() const
This is the common base class for memset/memcpy/memmove.
ConstantInt * getVolatileCst() const
void setVolatile(Constant *V)
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This class wraps the llvm.memmove intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Common base class for all memset intrinsics.
void setValue(Value *Val)
const Use & getValueUse() const
This class wraps the llvm.memset.inline intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
This class wraps the llvm.memset and llvm.memset.inline intrinsics.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Common base class for all memory transfer intrinsics.
unsigned getSourceAlignment() const
FIXME: Remove this function once transition to Align is over.
void setSource(Value *Ptr)
Value * getRawSource() const
Return the arguments to the instruction.
unsigned getSourceAddressSpace() const
MaybeAlign getSourceAlign() const
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it,...
void setSourceAlignment(MaybeAlign Alignment)
void setSourceAlignment(Align Alignment)
const Use & getRawSourceUse() const
This class wraps the llvm.memcpy/memmove intrinsics.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This class represents min/max intrinsics.
static bool classof(const Value *V)
static Constant * getSaturationPoint(Intrinsic::ID ID, Type *Ty)
Min/max intrinsics are monotonic, they operate on a fixed-bitwidth values, so there is a certain thre...
APInt getSaturationPoint(unsigned numBits) const
Min/max intrinsics are monotonic, they operate on a fixed-bitwidth values, so there is a certain thre...
static APInt getSaturationPoint(Intrinsic::ID ID, unsigned numBits)
Min/max intrinsics are monotonic, they operate on a fixed-bitwidth values, so there is a certain thre...
static ICmpInst::Predicate getPredicate(Intrinsic::ID ID)
Returns the comparison predicate underlying the intrinsic.
ICmpInst::Predicate getPredicate() const
Returns the comparison predicate underlying the intrinsic.
static bool isSigned(Intrinsic::ID ID)
Whether the intrinsic is signed or unsigned.
static bool classof(const IntrinsicInst *I)
bool isSigned() const
Whether the intrinsic is signed or unsigned.
Constant * getSaturationPoint(Type *Ty) const
Min/max intrinsics are monotonic, they operate on a fixed-bitwidth values, so there is a certain thre...
A Module instance is used to store all the information related to an LLVM module.
static bool classof(const IntrinsicInst *I)
void setScopeList(MDNode *ScopeList)
static bool classof(const Value *V)
MDNode * getScopeList() const
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
static PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
ConstantInt * getAttributes() const
ConstantInt * getIndex() const
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
ConstantInt * getFactor() const
ConstantInt * getFuncGuid() const
Lightweight class that wraps the location operand metadata of a debug intrinsic.
friend bool operator<=(const RawLocationWrapper &A, const RawLocationWrapper &B)
Metadata * getRawLocation() const
friend bool operator>(const RawLocationWrapper &A, const RawLocationWrapper &B)
RawLocationWrapper(Metadata *RawLocation)
RawLocationWrapper()=default
friend bool operator<(const RawLocationWrapper &A, const RawLocationWrapper &B)
friend bool operator==(const RawLocationWrapper &A, const RawLocationWrapper &B)
iterator_range< location_op_iterator > location_ops() const
Get the locations corresponding to the variable referenced by the debug info intrinsic.
Value * getVariableLocationOp(unsigned OpIdx) const
bool isKillLocation(const DIExpression *Expression) const
friend bool operator!=(const RawLocationWrapper &A, const RawLocationWrapper &B)
unsigned getNumVariableLocationOps() const
friend bool operator>=(const RawLocationWrapper &A, const RawLocationWrapper &B)
Represents a saturating add/sub intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
The instances of the Type class are immutable: once they are created, they are never changed.
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
static IntegerType * getInt8Ty(LLVMContext &C)
A Use represents the edge between a Value definition and its users.
void setOperand(unsigned i, Value *Val)
Value * getOperand(unsigned i) const
This represents the llvm.va_copy intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This represents the llvm.va_end intrinsic.
Value * getArgList() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This represents the llvm.va_start intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
Value * getArgList() const
static bool isVPBinOp(Intrinsic::ID ID)
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V)
static bool isVPCast(Intrinsic::ID ID)
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V)
static bool isVPCmp(Intrinsic::ID ID)
CmpInst::Predicate getPredicate() const
This is the common base class for vector predication intrinsics.
std::optional< unsigned > getFunctionalIntrinsicID() const
static bool classof(const Value *V)
static Function * getDeclarationForParams(Module *M, Intrinsic::ID, Type *ReturnType, ArrayRef< Value * > Params)
Declares a llvm.vp.
static std::optional< unsigned > getMaskParamPos(Intrinsic::ID IntrinsicID)
bool canIgnoreVectorLengthParam() const
void setMaskParam(Value *)
static std::optional< unsigned > getFunctionalOpcodeForVP(Intrinsic::ID ID)
static std::optional< unsigned > getMemoryDataParamPos(Intrinsic::ID)
Value * getVectorLengthParam() const
static bool classof(const IntrinsicInst *I)
static std::optional< Intrinsic::ID > getFunctionalIntrinsicIDForVP(Intrinsic::ID ID)
void setVectorLengthParam(Value *)
static std::optional< unsigned > getVectorLengthParamPos(Intrinsic::ID IntrinsicID)
static Intrinsic::ID getForOpcode(unsigned OC)
The llvm.vp.* intrinsics for this instruction Opcode.
static std::optional< unsigned > getMemoryPointerParamPos(Intrinsic::ID)
static bool isVPIntrinsic(Intrinsic::ID)
Value * getMemoryDataParam() const
static Intrinsic::ID getForIntrinsic(Intrinsic::ID Id)
The llvm.vp.
Value * getMemoryPointerParam() const
std::optional< unsigned > getConstrainedIntrinsicID() const
MaybeAlign getPointerAlignment() const
Value * getMaskParam() const
ElementCount getStaticVectorLength() const
static std::optional< Intrinsic::ID > getConstrainedIntrinsicIDForVP(Intrinsic::ID ID)
std::optional< unsigned > getFunctionalOpcode() const
This represents vector predication reduction intrinsics.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool isVPReduction(Intrinsic::ID ID)
unsigned getStartParamPos() const
unsigned getVectorParamPos() const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
LLVMContext & getContext() const
All values hold a context through their type.
Represents an op.with.overflow intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
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.
bool operator==(const location_op_iterator &RHS) const
location_op_iterator & operator=(const location_op_iterator &R)
location_op_iterator(ValueAsMetadata **MultiIter)
location_op_iterator(const location_op_iterator &R)
location_op_iterator & operator++()
location_op_iterator(ValueAsMetadata *SingleIter)
location_op_iterator & operator--()
const Value * operator*() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static const int NoAliasScopeDeclScopeArg
This is an optimization pass for GlobalISel generic memory operations.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
static bool isLifetimeIntrinsic(Intrinsic::ID ID)
Check if ID corresponds to a lifetime intrinsic.
static bool isDbgInfoIntrinsic(Intrinsic::ID ID)
Check if ID corresponds to a debug info intrinsic.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
static bool isConvergenceControlIntrinsic(unsigned IntrinsicID)
Check if ID corresponds to a convergence control intrinsic.
This struct is a compact representation of a valid (non-zero power of two) alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.