24 #ifndef LLVM_IR_INTRINSICINST_H 25 #define LLVM_IR_INTRINSICINST_H 58 return CF->isIntrinsic();
62 return isa<CallInst>(V) &&
classof(cast<CallInst>(V));
78 default:
return false;
82 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
93 Value *getVariableLocation(
bool AllowNullOp =
true)
const;
102 return cast<DILocalVariable>(getRawVariable());
106 return cast<DIExpression>(getRawExpression());
129 default:
return false;
133 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
149 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
165 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
173 return getVariableLocation(
false);
182 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
191 return cast<DILabel>(getRawLabel());
204 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
229 bool isTernaryOp()
const;
261 default:
return false;
265 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
275 enum { ARG_DEST = 0, ARG_LENGTH = 2 };
296 return cast<PointerType>(getRawDest()->getType())->getAddressSpace();
304 "setDest called with pointer of wrong type!");
317 "setLength called with value of wrong type!");
326 enum { ARG_SOURCE = 1 };
331 return const_cast<Value *
>(BaseCL::getArgOperand(ARG_SOURCE));
334 return BaseCL::getArgOperandUse(ARG_SOURCE);
344 return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
348 return BaseCL::getParamAlignment(ARG_SOURCE);
353 "setSource called with pointer of wrong type!");
354 BaseCL::setArgOperand(ARG_SOURCE, Ptr);
361 BaseCL::getContext(), Align));
369 enum { ARG_VALUE = 1 };
373 return const_cast<Value *
>(BaseCL::getArgOperand(ARG_VALUE));
376 return BaseCL::getArgOperandUse(ARG_VALUE);
382 "setValue called with value of wrong type!");
383 BaseCL::setArgOperand(ARG_VALUE, Val);
391 enum { ARG_ELEMENTSIZE = 3 };
399 return cast<ConstantInt>(getRawElementSizeInBytes());
403 return getElementSizeInBytesCst()->getZExtValue();
408 "setElementSizeInBytes called with value of wrong type!");
423 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
435 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
453 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
465 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
477 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
484 enum { ARG_VOLATILE = 3 };
488 return cast<ConstantInt>(
493 return !getVolatileCst()->isZero();
505 default:
return false;
509 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
521 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
534 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
546 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
558 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
570 if (
auto *
MI = dyn_cast<MemIntrinsic>(
this))
571 return MI->isVolatile();
589 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
608 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
629 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
648 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
667 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
678 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
691 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
704 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
718 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
722 return cast<GlobalVariable>(
738 Value *getStep()
const;
747 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
758 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
762 return cast<GlobalVariable>(
786 #endif // LLVM_IR_INTRINSICINST_H static bool classof(const Value *V)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
IntrinsicInst & operator=(const IntrinsicInst &)=delete
ConstantInt * getIndex() const
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
This represents the llvm.dbg.label instruction.
This class represents lattice values for constants.
This represents the llvm.va_end intrinsic.
static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align)
Return a uniquified Attribute object that has the specific alignment set.
Value * getRawElementSizeInBytes() const
This class represents a function call, abstracting a target machine's calling convention.
static bool classof(const CallInst *I)
unsigned getSourceAlignment() const
static bool classof(const IntrinsicInst *I)
This class represents the atomic memcpy intrinsic i.e.
unsigned getSourceAddressSpace() const
static bool classof(const Value *V)
LLVMContext & getContext() const
All values hold a context through their type.
void setSource(Value *Ptr)
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
This class wraps the llvm.memset intrinsic.
void setVolatile(Constant *V)
void setArgOperand(unsigned i, Value *v)
static bool classof(const IntrinsicInst *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V)
This is the common base class for constrained floating point intrinsics.
Value * getLength() const
unsigned getParamAlignment(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
Value * getArgList() const
static bool classof(const IntrinsicInst *I)
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions (including addrspacecast) that ...
Value * getArgOperand(unsigned i) const
static bool classof(const Value *V)
This class wraps the llvm.memmove intrinsic.
A Use represents the edge between a Value definition and its users.
DILabel * getLabel() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
unsigned getDestAlignment() const
This class represents atomic memset intrinsic.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Type * getType() const
All values are typed, get the type of this value.
This represents the llvm.va_start intrinsic.
const Use & getRawSourceUse() const
static bool classof(const Value *V)
This is the common base class for debug info intrinsics for variables.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
static bool classof(const Value *V)
GlobalVariable * getName() const
ConstantInt * getNumCounters() const
static bool classof(const Value *V)
static bool classof(const Value *V)
static bool classof(const Value *V)
const Use & getValueUse() const
ConstantInt * getHash() const
static bool classof(const Value *V)
This class represents the atomic memmove intrinsic i.e.
Metadata * getRawExpression() const
static bool classof(const Value *V)
static bool classof(const Value *V)
ConstantInt * getIndex() const
static bool classof(const IntrinsicInst *I)
Value * getAddress() const
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static bool classof(const Value *V)
DIExpression * getExpression() const
Metadata * getRawLabel() const
static bool classof(const IntrinsicInst *I)
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)
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
This represents the llvm.dbg.addr instruction.
uint32_t getElementSizeInBytes() const
static bool classof(const IntrinsicInst *I)
Common base class for all memset intrinsics.
ConstantInt * getVolatileCst() const
ConstantInt * getElementSizeInBytesCst() const
static bool classof(const IntrinsicInst *I)
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
This is the common base class for memset/memcpy/memmove.
const Use & getLengthUse() const
This is the shared class of boolean and integer constants.
Value * getArgList() const
void setValue(Value *Val)
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Metadata * getRawVariable() const
This is the common base class for debug info intrinsics.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This class wraps the llvm.memcpy intrinsic.
Value * getRawSource() const
Return the arguments to the instruction.
static bool classof(const Value *V)
Common base class for all memory transfer intrinsics.
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
static bool classof(const Value *V)
This represents the llvm.instrprof_increment intrinsic.
void setElementSizeInBytes(Constant *V)
This class wraps the llvm.memcpy/memmove intrinsics.
unsigned getDestAddressSpace() const
static bool classof(const IntrinsicInst *I)
Value * getTargetValue() const
This represents the llvm.dbg.value instruction.
bool isAddressOfVariable() const
Does this describe the address of a local variable.
ConstantInt * getHash() const
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
static bool classof(const Value *V)
static bool classof(const Value *V)
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a call argument.
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
Common base class for all memory intrinsics.
DILocalVariable * getVariable() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
This represents the llvm.va_copy intrinsic.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool classof(const Value *V)
LLVM Value Representation.
static bool classof(const IntrinsicInst *I)
This class represents any memmove intrinsic i.e.
GlobalVariable * getName() const
ConstantInt * getValueKind() const
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it...
void setSourceAlignment(unsigned Align)
This class represents any memcpy intrinsic i.e.
This represents the llvm.instrprof_value_profile intrinsic.
This represents the llvm.dbg.declare instruction.
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
static IntegerType * getInt8Ty(LLVMContext &C)
Value * getRawDest() const
static bool classof(const IntrinsicInst *I)
const Use & getRawDestUse() const
void setDestAlignment(unsigned Align)
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
A wrapper class for inspecting calls to intrinsic functions.
Value * getAddress() const