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));
77 case Intrinsic::dbg_declare:
78 case Intrinsic::dbg_value:
80 default:
return false;
84 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
114 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
126 return cast<ConstantInt>(
151 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
181 case Intrinsic::experimental_constrained_fadd:
182 case Intrinsic::experimental_constrained_fsub:
183 case Intrinsic::experimental_constrained_fmul:
184 case Intrinsic::experimental_constrained_fdiv:
185 case Intrinsic::experimental_constrained_frem:
186 case Intrinsic::experimental_constrained_sqrt:
187 case Intrinsic::experimental_constrained_pow:
188 case Intrinsic::experimental_constrained_powi:
189 case Intrinsic::experimental_constrained_sin:
190 case Intrinsic::experimental_constrained_cos:
191 case Intrinsic::experimental_constrained_exp:
192 case Intrinsic::experimental_constrained_exp2:
193 case Intrinsic::experimental_constrained_log:
194 case Intrinsic::experimental_constrained_log10:
195 case Intrinsic::experimental_constrained_log2:
196 case Intrinsic::experimental_constrained_rint:
197 case Intrinsic::experimental_constrained_nearbyint:
199 default:
return false;
203 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
212 enum { ARG_DEST = 0, ARG_SOURCE = 1, ARG_LENGTH = 2, ARG_ELEMENTSIZE = 3 };
269 "setDest called with pointer of wrong type!");
275 "setSource called with pointer of wrong type!");
281 "setLength called with value of wrong type!");
287 "setElementSizeInBytes called with value of wrong type!");
292 return I->
getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic;
295 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
301 enum { ARG_DEST = 0, ARG_SOURCE = 1, ARG_LENGTH = 2, ARG_ELEMENTSIZE = 3 };
358 "setDest called with pointer of wrong type!");
364 "setSource called with pointer of wrong type!");
370 "setLength called with value of wrong type!");
376 "setElementSizeInBytes called with value of wrong type!");
381 return I->
getIntrinsicID() == Intrinsic::memmove_element_unordered_atomic;
384 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
393 enum { ARG_DEST = 0, ARG_VALUE = 1, ARG_LENGTH = 2, ARG_ELEMENTSIZE = 3 };
438 "setDest called with pointer of wrong type!");
444 "setValue called with value of wrong type!");
450 "setLength called with value of wrong type!");
456 "setElementSizeInBytes called with value of wrong type!");
461 return I->
getIntrinsicID() == Intrinsic::memset_element_unordered_atomic;
464 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
507 "setDest called with pointer of wrong type!");
513 "setLength called with value of wrong type!");
532 case Intrinsic::memcpy:
533 case Intrinsic::memmove:
534 case Intrinsic::memset:
536 default:
return false;
540 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
554 "setValue called with value of wrong type!");
563 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
586 "setSource called with pointer of wrong type!");
596 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
608 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
620 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
631 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
644 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
657 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
671 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
675 return cast<GlobalVariable>(
697 return I->
getIntrinsicID() == Intrinsic::instrprof_increment_step;
700 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
711 return isa<IntrinsicInst>(V) &&
classof(cast<IntrinsicInst>(V));
715 return cast<GlobalVariable>(
739 #endif // LLVM_IR_INTRINSICINST_H
unsigned getAlignment() const
uint32_t getElementSizeInBytes() const
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
Value * getRawDest() const
Value * getRawSource() const
Return the arguments to the instruction.
unsigned getSourceAddressSpace() const
static bool classof(const Value *V)
IntrinsicInst & operator=(const IntrinsicInst &)=delete
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions that feed it, giving the original input.
static bool classof(const IntrinsicInst *I)
unsigned getDestAddressSpace() const
Metadata * getRawVariable() const
This represents the llvm.va_end intrinsic.
unsigned getDestAddressSpace() const
static bool classof(const Value *V)
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions that feed it, giving the original input.
ConstantInt * getAlignmentCst() const
Value * getValue() const
Return the arguments to the instruction.
void setElementSizeInBytes(Constant *V)
This class represents a function call, abstracting a target machine's calling convention.
static bool classof(const CallInst *I)
void setSource(Value *Ptr)
static bool classof(const IntrinsicInst *I)
ConstantInt * getIndex() const
static bool classof(const Value *V)
unsigned getSourceAddressSpace() const
unsigned getDestAddressSpace() const
This class wraps the llvm.memset intrinsic.
void setVolatile(Constant *V)
void setValue(Value *Val)
Value * getRawElementSizeInBytes() const
static bool classof(const IntrinsicInst *I)
This is the common base class for constrained floating point intrinsics.
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a call argument.
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
void setAlignment(Constant *A)
uint64_t getOffset() const
ConstantInt * getHash() const
Value * getRawSource() const
Return the arguments to the instruction.
static bool classof(const IntrinsicInst *I)
Value * getAddress() const
Value * getRawDest() const
Value * getArgList() const
This class wraps the llvm.memmove intrinsic.
A Use represents the edge between a Value definition and its users.
const Use & getRawDestUse() const
ConstantInt * getIndex() const
const Use & getLengthUse() const
Type * getAlignmentType() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
Value * getLength() const
uint32_t getElementSizeInBytes() const
const Use & getRawDestUse() const
ConstantInt * getElementSizeInBytesCst() const
ConstantInt * getNumCounters() const
void setElementSizeInBytes(Constant *V)
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
This represents the llvm.va_start intrinsic.
const Use & getValueUse() const
ConstantInt * getElementSizeInBytesCst() const
Metadata * getRawExpression() const
static bool classof(const Value *V)
ConstantInt * getHash() const
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
static bool classof(const Value *V)
void setElementSizeInBytes(Constant *V)
static bool classof(const Value *V)
GlobalVariable * getName() const
const Use & getRawSourceUse() const
Value * getRawDest() const
const Use & getValueUse() const
Value * getArgList() const
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
GlobalVariable * getName() const
The instances of the Type class are immutable: once they are created, they are never changed...
DIExpression * getExpression() const
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
void setSource(Value *Ptr)
Value * getRawDest() const
static bool classof(const Value *V)
Metadata * getRawVariable() const
ConstantInt * getVolatileCst() const
static bool classof(const Value *V)
Value * getTargetValue() const
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions that feed it, giving the original input.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
LLVMContext & getContext() const
All values hold a context through their type.
ExceptionBehavior getExceptionBehavior() const
static bool classof(const IntrinsicInst *I)
const Use & getRawSourceUse() const
Value * getRawElementSizeInBytes() const
const Use & getLengthUse() const
DIExpression * getExpression() const
This is the common base class for memset/memcpy/memmove.
This is the shared class of boolean and integer constants.
Value * getDest() const
This is just like getRawDest, but it strips off any cast instructions that feed it, giving the original input.
Metadata * getRawExpression() const
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.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
This is the common base class for debug info intrinsics.
static bool classof(const Value *V)
Value * getLength() const
static bool classof(const IntrinsicInst *I)
This class wraps the llvm.memcpy intrinsic.
Function * getCalledFunction() const
Return the function called, or null if this is an indirect function invocation.
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
static bool classof(const Value *V)
This class represents atomic memset intrinsic TODO: Integrate this class into MemIntrinsic hierarchy;...
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
This class represents atomic memcpy intrinsic TODO: Integrate this class into MemIntrinsic hierarchy;...
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th call argument.
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
void setValue(Value *Val)
This represents the llvm.instrprof_increment intrinsic.
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it...
This class wraps the llvm.memcpy/memmove intrinsics.
const Use & getRawSourceUse() const
void setDest(Value *Ptr)
Set the specified arguments of the instruction.
ConstantInt * getElementSizeInBytesCst() const
This represents the llvm.dbg.value instruction.
RoundingMode getRoundingMode() const
void setArgOperand(unsigned i, Value *v)
void setSource(Value *Ptr)
static bool classof(const Value *V)
Value * getVariableLocation(bool AllowNullOp=true) const
Get the location corresponding to the variable referenced by the debug info intrinsic.
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it...
static bool classof(const Value *V)
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
uint32_t getElementSizeInBytes() const
Value * getRawSource() const
Return the arguments to the instruction.
This represents the llvm.va_copy intrinsic.
DILocalVariable * getVariable() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Value * getLength() const
DILocalVariable * getVariable() const
unsigned getDestAddressSpace() const
static bool classof(const Value *V)
static bool classof(const Value *V)
Value * getLength() const
Value * getSource() const
This is just like getRawSource, but it strips off any cast instructions that feed it...
ConstantInt * getValueKind() const
const Use & getLengthUse() const
const Use & getLengthUse() const
This represents the llvm.instrprof_value_profile intrinsic.
const Use & getRawDestUse() const
unsigned getSourceAddressSpace() const
This represents the llvm.dbg.declare instruction.
const Use & getRawDestUse() const
Value * getRawElementSizeInBytes() const
static IntegerType * getInt8Ty(LLVMContext &C)
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
static bool classof(const IntrinsicInst *I)
A wrapper class for inspecting calls to intrinsic functions.