Go to the documentation of this file.
14 #ifndef LLVM_IR_ABSTRACTCALLSITE_H
15 #define LLVM_IR_ABSTRACTCALLSITE_H
109 explicit operator bool()
const {
return CB !=
nullptr; }
142 "Callback without parameter encoding!");
146 if (
auto *CE = dyn_cast<ConstantExpr>(U->getUser()))
147 if (CE->hasOneUse() && CE->isCast())
148 U = &*CE->use_begin();
204 assert(CalleeArgIdx >= 0 &&
225 template <
typename UnaryFunction>
229 for (
const Use *U : CallbackUses) {
237 template <
typename UnaryFunction>
247 #endif // LLVM_IR_ABSTRACTCALLSITE_H
This class represents an incoming formal argument to a Function.
user_iterator_impl< const User > const_user_iterator
void forEachCallbackCallSite(const CallBase &CB, UnaryFunction Func)
Apply function Func to each CB's callback call site.
Value * getCalledOperand() const
Return the pointer to function that is being called.
This is an optimization pass for GlobalISel generic memory operations.
The encoding of a callback with regards to the underlying instruction.
static void getCallbackUses(const CallBase &CB, SmallVectorImpl< const Use * > &CallbackUses)
Add operand uses of CB that represent callback uses into CallbackUses.
bool isCallee(const Use *U) const
Return true if U is the use that defines the callee of this ACS.
int getCallArgOperandNoForCallee() const
Return the operand index of the underlying instruction associated with the callee of this ACS.
bool isCallee(Value::const_user_iterator UI) const
Determine whether the passed iterator points to the callee operand's Use.
int getCallArgOperandNo(unsigned ArgNo) const
Return the operand index of the underlying instruction associated with the function parameter number ...
unsigned getNumArgOperands() const
Return the number of parameters of the callee.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
const Use & getOperandUse(unsigned i) const
bool isDirectCall() const
Return true if this ACS represents a direct call.
ParameterEncodingTy ParameterEncoding
AbstractCallSite(const Use *U)
Sole constructor for abstract call sites (ACS).
CallBase * getInstruction() const
Return the underlying instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const Use & getCalleeUseForCallback() const
Return the use of the callee value in the underlying instruction.
bool isCallbackCall() const
Return true if this ACS represents a callback call.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Value * getCallArgOperand(unsigned ArgNo) const
Return the operand of the underlying instruction associated with the function parameter number ArgNo ...
unsigned arg_size() const
bool isIndirectCall() const
Return true if the callsite is an indirect call.
unsigned getArgOperandNo(const Use *U) const
Given a use for a arg operand, get the arg operand number that corresponds to it.
void forEachCallbackFunction(const CallBase &CB, UnaryFunction Func)
Apply function Func to each CB's callback function.
Value * getCalledOperand() const
bool isIndirectCall() const
Return true if this ACS represents an indirect call.
Value * getArgOperand(unsigned i) const
bool isCallee(Value::const_user_iterator UI) const
Return true if UI is the use that defines the callee of this ACS.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Function * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
Value * getCallArgOperand(Argument &Arg) const
Return the operand of the underlying instruction associated with Arg.
LLVM Value Representation.
int getCallArgOperandNo(Argument &Arg) const
Return the operand index of the underlying instruction associated with Arg.
A Use represents the edge between a Value definition and its users.