23#ifndef LLVM_IR_INTRINSICINST_H
24#define LLVM_IR_INTRINSICINST_H
76 case Intrinsic::maxnum:
77 case Intrinsic::minnum:
78 case Intrinsic::maximum:
79 case Intrinsic::minimum:
80 case Intrinsic::maximumnum:
81 case Intrinsic::minimumnum:
86 case Intrinsic::sadd_sat:
87 case Intrinsic::uadd_sat:
88 case Intrinsic::sadd_with_overflow:
89 case Intrinsic::uadd_with_overflow:
90 case Intrinsic::smul_with_overflow:
91 case Intrinsic::umul_with_overflow:
92 case Intrinsic::smul_fix:
93 case Intrinsic::umul_fix:
94 case Intrinsic::smul_fix_sat:
95 case Intrinsic::umul_fix_sat:
97 case Intrinsic::fmuladd:
106 constexpr unsigned NumCommutativeOps = 2;
114 case Intrinsic::assume:
115 case Intrinsic::sideeffect:
116 case Intrinsic::pseudoprobe:
117 case Intrinsic::dbg_assign:
118 case Intrinsic::dbg_declare:
119 case Intrinsic::dbg_value:
120 case Intrinsic::dbg_label:
121 case Intrinsic::invariant_start:
122 case Intrinsic::invariant_end:
123 case Intrinsic::lifetime_start:
124 case Intrinsic::lifetime_end:
125 case Intrinsic::experimental_noalias_scope_decl:
126 case Intrinsic::objectsize:
127 case Intrinsic::ptr_annotation:
128 case Intrinsic::var_annotation:
141 return F &&
F->isIntrinsic();
151 case Intrinsic::lifetime_start:
152 case Intrinsic::lifetime_end:
176 case Intrinsic::dbg_declare:
177 case Intrinsic::dbg_value:
178 case Intrinsic::dbg_label:
179 case Intrinsic::dbg_assign:
205 std::bidirectional_iterator_tag, Value *> {
255 : RawLocation(RawLocation) {
257 assert(RawLocation &&
"unexpected null RawLocation");
289 return A.RawLocation ==
B.RawLocation;
297 return A.RawLocation >
B.RawLocation;
301 return A.RawLocation >=
B.RawLocation;
305 return A.RawLocation <
B.RawLocation;
309 return A.RawLocation <=
B.RawLocation;
324 bool AllowEmpty =
false);
366 if (!RemovedValues.
insert(OldValue).second)
427 return VariableSlice;
433 switch (
I->getIntrinsicID()) {
434 case Intrinsic::dbg_declare:
435 case Intrinsic::dbg_value:
436 case Intrinsic::dbg_assign:
458 "dbg.declare must have exactly 1 location operand.");
465 return I->getIntrinsicID() == Intrinsic::dbg_declare;
488 return I->getIntrinsicID() == Intrinsic::dbg_value ||
489 I->getIntrinsicID() == Intrinsic::dbg_assign;
540 return I->getIntrinsicID() == Intrinsic::dbg_assign;
563 return I->getIntrinsicID() == Intrinsic::dbg_label;
581 LLVM_ABI static std::optional<unsigned>
583 LLVM_ABI static std::optional<unsigned>
618 LLVM_ABI static std::optional<unsigned>
649 LLVM_ABI static std::optional<unsigned>
653 LLVM_ABI static std::optional<Intrinsic::ID>
657 LLVM_ABI static std::optional<Intrinsic::ID>
751 return getIntrinsicID() == Intrinsic::experimental_constrained_fcmps;
756 switch (
I->getIntrinsicID()) {
757 case Intrinsic::experimental_constrained_fcmp:
758 case Intrinsic::experimental_constrained_fcmps:
773 switch (
I->getIntrinsicID()) {
774 case Intrinsic::umin:
775 case Intrinsic::umax:
776 case Intrinsic::smin:
777 case Intrinsic::smax:
793 case Intrinsic::umin:
795 case Intrinsic::umax:
797 case Intrinsic::smin:
799 case Intrinsic::smax:
822 case Intrinsic::umin:
823 case Intrinsic::smin:
825 case Intrinsic::umax:
826 case Intrinsic::smax:
843 case Intrinsic::umin:
845 case Intrinsic::umax:
847 case Intrinsic::smin:
849 case Intrinsic::smax:
867 case Intrinsic::umin:
869 case Intrinsic::umax:
871 case Intrinsic::smin:
873 case Intrinsic::smax:
907 switch (
I->getIntrinsicID()) {
908 case Intrinsic::scmp:
909 case Intrinsic::ucmp:
945 switch (
I->getIntrinsicID()) {
946 case Intrinsic::uadd_with_overflow:
947 case Intrinsic::sadd_with_overflow:
948 case Intrinsic::usub_with_overflow:
949 case Intrinsic::ssub_with_overflow:
950 case Intrinsic::umul_with_overflow:
951 case Intrinsic::smul_with_overflow:
952 case Intrinsic::uadd_sat:
953 case Intrinsic::sadd_sat:
954 case Intrinsic::usub_sat:
955 case Intrinsic::ssub_sat:
982 switch (
I->getIntrinsicID()) {
983 case Intrinsic::uadd_with_overflow:
984 case Intrinsic::sadd_with_overflow:
985 case Intrinsic::usub_with_overflow:
986 case Intrinsic::ssub_with_overflow:
987 case Intrinsic::umul_with_overflow:
988 case Intrinsic::smul_with_overflow:
1003 switch (
I->getIntrinsicID()) {
1004 case Intrinsic::uadd_sat:
1005 case Intrinsic::sadd_sat:
1006 case Intrinsic::usub_sat:
1007 case Intrinsic::ssub_sat:
1024 enum { ARG_DEST = 0, ARG_LENGTH = 2 };
1042 return std::nullopt;
1043 return C->getValue();
1060 "setDest called with pointer of wrong type!");
1078 "setLength called with value of wrong type!");
1091 enum { ARG_SOURCE = 1 };
1096 return const_cast<Value *
>(BaseCL::getArgOperand(ARG_SOURCE));
1099 return BaseCL::getArgOperandUse(ARG_SOURCE);
1113 return BaseCL::getParamAlign(ARG_SOURCE);
1118 "setSource called with pointer of wrong type!");
1119 BaseCL::setArgOperand(ARG_SOURCE, Ptr);
1123 BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
1126 BaseCL::getContext(), *Alignment));
1130 BaseCL::removeParamAttr(ARG_SOURCE, Attribute::Alignment);
1132 BaseCL::getContext(), Alignment));
1140 enum { ARG_VALUE = 1 };
1144 return const_cast<Value *
>(BaseCL::getArgOperand(ARG_VALUE));
1151 "setValue called with value of wrong type!");
1152 BaseCL::setArgOperand(ARG_VALUE, Val);
1159 enum { ARG_VOLATILE = 3 };
1172 case Intrinsic::memset_inline:
1173 case Intrinsic::memcpy_inline:
1182 switch (
I->getIntrinsicID()) {
1183 case Intrinsic::memcpy:
1184 case Intrinsic::memmove:
1185 case Intrinsic::memset:
1186 case Intrinsic::memset_inline:
1187 case Intrinsic::memcpy_inline:
1203 switch (
I->getIntrinsicID()) {
1204 case Intrinsic::memset:
1205 case Intrinsic::memset_inline:
1221 enum { ARG_VOLATILE = 3 };
1234 return I->getIntrinsicID() == Intrinsic::experimental_memset_pattern;
1246 switch (
I->getIntrinsicID()) {
1247 case Intrinsic::memcpy:
1248 case Intrinsic::memmove:
1249 case Intrinsic::memcpy_inline:
1265 return I->getIntrinsicID() == Intrinsic::memcpy ||
1266 I->getIntrinsicID() == Intrinsic::memcpy_inline;
1278 return I->getIntrinsicID() == Intrinsic::memmove;
1291 enum { ARG_ELEMENTSIZE = 3 };
1297 return MI->isVolatile();
1303 case Intrinsic::memcpy_element_unordered_atomic:
1304 case Intrinsic::memmove_element_unordered_atomic:
1305 case Intrinsic::memset_element_unordered_atomic:
1313 switch (
I->getIntrinsicID()) {
1314 case Intrinsic::memcpy:
1315 case Intrinsic::memcpy_inline:
1316 case Intrinsic::memmove:
1317 case Intrinsic::memset:
1318 case Intrinsic::memset_inline:
1319 case Intrinsic::memcpy_element_unordered_atomic:
1320 case Intrinsic::memmove_element_unordered_atomic:
1321 case Intrinsic::memset_element_unordered_atomic:
1348 switch (
I->getIntrinsicID()) {
1349 case Intrinsic::memset:
1350 case Intrinsic::memset_inline:
1351 case Intrinsic::memset_element_unordered_atomic:
1368 switch (
I->getIntrinsicID()) {
1369 case Intrinsic::memcpy:
1370 case Intrinsic::memcpy_inline:
1371 case Intrinsic::memmove:
1372 case Intrinsic::memcpy_element_unordered_atomic:
1373 case Intrinsic::memmove_element_unordered_atomic:
1390 switch (
I->getIntrinsicID()) {
1391 case Intrinsic::memcpy:
1392 case Intrinsic::memcpy_inline:
1393 case Intrinsic::memcpy_element_unordered_atomic:
1410 switch (
I->getIntrinsicID()) {
1411 case Intrinsic::memmove:
1412 case Intrinsic::memmove_element_unordered_atomic:
1427 return I->getIntrinsicID() == Intrinsic::vastart;
1440 return I->getIntrinsicID() == Intrinsic::vaend;
1453 return I->getIntrinsicID() == Intrinsic::vacopy;
1467 switch (
I.getIntrinsicID()) {
1468 case Intrinsic::instrprof_cover:
1469 case Intrinsic::instrprof_increment:
1470 case Intrinsic::instrprof_increment_step:
1471 case Intrinsic::instrprof_callsite:
1472 case Intrinsic::instrprof_timestamp:
1473 case Intrinsic::instrprof_value_profile:
1479 switch (
I.getIntrinsicID()) {
1480 case Intrinsic::instrprof_mcdc_parameters:
1481 case Intrinsic::instrprof_mcdc_tvbitmap_update:
1530 return I->getIntrinsicID() == Intrinsic::instrprof_cover;
1541 return I->getIntrinsicID() == Intrinsic::instrprof_increment ||
1542 I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
1554 return I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
1568 return I->getIntrinsicID() == Intrinsic::instrprof_callsite;
1587 return I->getIntrinsicID() == Intrinsic::instrprof_timestamp;
1598 return I->getIntrinsicID() == Intrinsic::instrprof_value_profile;
1641 return I->getIntrinsicID() == Intrinsic::instrprof_mcdc_parameters;
1652 return I->getIntrinsicID() == Intrinsic::instrprof_mcdc_tvbitmap_update;
1672 return I->getIntrinsicID() == Intrinsic::pseudoprobe;
1695 return I->getIntrinsicID() == Intrinsic::experimental_noalias_scope_decl;
1719 return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate ||
1720 I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1743 return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate;
1771 return I->getIntrinsicID() == Intrinsic::experimental_gc_result;
1784 return I->getIntrinsicID() == Intrinsic::assume;
1793 switch (IntrinsicID) {
1796 case Intrinsic::experimental_convergence_anchor:
1797 case Intrinsic::experimental_convergence_entry:
1798 case Intrinsic::experimental_convergence_loop:
1815 return getIntrinsicID() == Intrinsic::experimental_convergence_anchor;
1818 return getIntrinsicID() == Intrinsic::experimental_convergence_entry;
1821 return getIntrinsicID() == Intrinsic::experimental_convergence_loop;
1833 return I->getIntrinsicID() == Intrinsic::structured_alloca;
1848 return I->getIntrinsicID() == Intrinsic::structured_gep;
1876 CurrentType = AT->getElementType();
1878 CurrentType = VT->getElementType();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
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 ...
MachineInstr unsigned OpIdx
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)
Value * getRawElementSizeInBytes() const
uint32_t getElementSizeInBytes() const
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)
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Class to represent array types.
This represents the llvm.assume intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static LLVM_ABI Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
LLVM_ABI Type * getValueAsType() const
Return the attribute's value as a Type.
LLVM Basic Block Representation.
This class represents an intrinsic that is based on a binary operation.
static bool classof(const Value *V)
LLVM_ABI unsigned getNoWrapKind() const
Returns one of OBO::NoSignedWrap or OBO::NoUnsignedWrap.
LLVM_ABI bool isSigned() const
Whether the intrinsic is signed or unsigned.
static bool classof(const IntrinsicInst *I)
LLVM_ABI Instruction::BinaryOps getBinaryOp() const
Returns the binary operation underlying the intrinsic.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
bool isInlineAsm() const
Check if this call is an inline asm statement.
Attribute getRetAttr(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind for the return value.
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
Attribute getParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const
Get the attribute of a given kind from a given arg.
LLVM_ABI bool isIndirectCall() const
Return true if the callsite is an indirect call.
MaybeAlign getParamAlign(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
Value * getCalledOperand() const
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)
LLVM_ABI Intrinsic::ID getIntrinsicID() const
Returns the intrinsic ID of the intrinsic called or Intrinsic::not_intrinsic if the called function i...
unsigned arg_size() const
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
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 LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI std::optional< fp::ExceptionBehavior > getExceptionBehavior() const
LLVM_ABI std::optional< RoundingMode > getRoundingMode() const
LLVM_ABI unsigned getNonMetadataArgCount() const
static LLVM_ABI bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
LLVM_ABI bool isDefaultFPEnvironment() const
Represents calls to the llvm.experimintal.convergence.* intrinsics.
static bool classof(const Value *V)
static LLVM_ABI ConvergenceControlInst * CreateAnchor(BasicBlock &BB)
static LLVM_ABI ConvergenceControlInst * CreateLoop(BasicBlock &BB, ConvergenceControlInst *Parent)
static LLVM_ABI ConvergenceControlInst * CreateEntry(BasicBlock &BB)
static bool classof(const IntrinsicInst *I)
DbgVariableFragmentInfo FragmentInfo
static LLVM_ABI 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
LLVM_ABI void setValue(Value *V)
static bool classof(const Value *V)
LLVM_ABI void setAssignId(DIAssignID *New)
LLVM_ABI void setKillAddress()
Kill the address component.
LLVM_ABI bool isKillAddress() const
Check whether this kills the address component.
Metadata * getRawAddress() const
DIExpression * getAddressExpression() const
LLVM_ABI Value * getAddress() const
static bool classof(const IntrinsicInst *I)
Metadata * getRawAddressExpression() const
Metadata * getRawAssignID() const
LLVM_ABI 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)
LLVM_ABI iterator_range< location_op_iterator > location_ops() const
Get the locations corresponding to the variable referenced by the debug info intrinsic.
LLVM_ABI void addVariableLocationOps(ArrayRef< Value * > NewValues, DIExpression *NewExpr)
Adding a new location operand will always result in this intrinsic using an ArgList,...
bool isValueOfVariable() const
Determine if this describes the value of a local variable.
void setRawLocation(Metadata *Location)
Use of this should generally be avoided; instead, replaceVariableLocationOp and addVariableLocationOp...
LLVM_ABI void replaceVariableLocationOp(Value *OldValue, Value *NewValue, bool AllowEmpty=false)
LLVM_ABI 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)
LLVM_ABI 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.
Common base class for representing values projected from a statepoint.
LLVM_ABI 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)
LLVM_ABI Value * getBasePtr() const
unsigned getBasePtrIndex() const
The index into the associate statepoint's argument list which contains the base pointer of the pointe...
LLVM_ABI 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.
LLVM_ABI void setCallee(Value *Callee)
LLVM_ABI Value * getCallee() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static bool canInstrumentCallsite(const CallBase &CB)
A base class for all instrprof counter intrinsics.
static bool classof(const Value *V)
LLVM_ABI ConstantInt * getIndex() const
LLVM_ABI void setIndex(uint32_t Idx)
LLVM_ABI 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)
LLVM_ABI Value * getStep() const
A base class for all instrprof intrinsics.
static bool classof(const Value *V)
void setNameValue(Value *V)
GlobalVariable * getName() const
ConstantInt * getHash() const
Value * getNameValue() 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 LLVM_ABI 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.
bool isCommutableOperand(unsigned Op) const
Return true if the operand is commutable.
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 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 setLength(uint64_t L)
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
MaybeAlign getDestAlign() const
const Use & getLengthUse() const
unsigned getDestAddressSpace() const
std::optional< APInt > getLengthInBytes() const
This is the common base class for memset/memcpy/memmove.
ConstantInt * getVolatileCst() const
void setVolatile(Constant *V)
bool isForceInlined() const
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 and llvm.memset.inline intrinsics.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This class wraps the llvm.experimental.memset.pattern intrinsic.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
ConstantInt * getVolatileCst() const
void setVolatile(Constant *V)
Common base class for all memory transfer intrinsics.
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...
APInt getIdentity() const
Returns the identity value for this min/max intrinsic, such that minmax(X, Identity) == X.
bool isMin() const
Whether the intrinsic is a smin or a umin.
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 isMin(Intrinsic::ID ID)
Whether the intrinsic is a smin or umin.
static bool isSigned(Intrinsic::ID ID)
Whether the intrinsic is signed or unsigned.
static APInt getIdentity(Intrinsic::ID ID, unsigned NumBits)
Returns the identity value for this min/max intrinsic, such that minmax(X, Identity) == X.
bool isMax() const
Whether the intrinsic is a smax or a umax.
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 bits of the poi...
static LLVM_ABI 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)
LLVM_ABI iterator_range< location_op_iterator > location_ops() const
Get the locations corresponding to the variable referenced by the debug info intrinsic.
LLVM_ABI 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.
Class to represent struct types.
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
Type * getAllocationType() const
static bool classof(const IntrinsicInst *I)
unsigned getNumIndices() const
static unsigned getPointerOperandIndex()
static bool classof(const Value *V)
Value * getPointerOperand() const
Type * getResultElementType() const
Value * getIndexOperand(size_t Index) const
Type * getBaseType() const
The instances of the Type class are immutable: once they are created, they are never changed.
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 LLVM_ABI 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 LLVM_ABI 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 LLVM_ABI bool isVPCmp(Intrinsic::ID ID)
LLVM_ABI 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 LLVM_ABI std::optional< unsigned > getMaskParamPos(Intrinsic::ID IntrinsicID)
LLVM_ABI bool canIgnoreVectorLengthParam() const
LLVM_ABI void setMaskParam(Value *)
static LLVM_ABI std::optional< unsigned > getFunctionalOpcodeForVP(Intrinsic::ID ID)
static LLVM_ABI std::optional< unsigned > getMemoryDataParamPos(Intrinsic::ID)
LLVM_ABI Value * getVectorLengthParam() const
static bool classof(const IntrinsicInst *I)
static LLVM_ABI std::optional< Intrinsic::ID > getFunctionalIntrinsicIDForVP(Intrinsic::ID ID)
LLVM_ABI void setVectorLengthParam(Value *)
static LLVM_ABI std::optional< unsigned > getVectorLengthParamPos(Intrinsic::ID IntrinsicID)
static LLVM_ABI Intrinsic::ID getForOpcode(unsigned OC)
The llvm.vp.* intrinsics for this instruction Opcode.
static LLVM_ABI Function * getOrInsertDeclarationForParams(Module *M, Intrinsic::ID, Type *ReturnType, ArrayRef< Value * > Params)
Declares a llvm.vp.
static LLVM_ABI std::optional< unsigned > getMemoryPointerParamPos(Intrinsic::ID)
static LLVM_ABI bool isVPIntrinsic(Intrinsic::ID)
LLVM_ABI Value * getMemoryDataParam() const
static LLVM_ABI Intrinsic::ID getForIntrinsic(Intrinsic::ID Id)
The llvm.vp.
LLVM_ABI Value * getMemoryPointerParam() const
std::optional< unsigned > getConstrainedIntrinsicID() const
LLVM_ABI MaybeAlign getPointerAlignment() const
LLVM_ABI Value * getMaskParam() const
LLVM_ABI ElementCount getStaticVectorLength() const
static LLVM_ABI 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 LLVM_ABI bool isVPReduction(Intrinsic::ID ID)
LLVM_ABI unsigned getStartParamPos() const
LLVM_ABI unsigned getVectorParamPos() const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
LLVMContext & getContext() const
All values hold a context through their type.
LLVM_ABI const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Base class of all SIMD vector types.
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.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
static const int NoAliasScopeDeclScopeArg
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
auto dyn_cast_or_null(const Y &Val)
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.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
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...
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
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.