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
bool isCallee(const Use *U) const
Return true if U is the use that defines the callee of this ACS.
int getCallArgOperandNo(Argument &Arg) const
Return the operand index of the underlying instruction associated with Arg.
This class represents an incoming formal argument to a Function.
This class represents lattice values for constants.
static void getCallbackUses(const CallBase &CB, SmallVectorImpl< const Use * > &CallbackUses)
Add operand uses of CB that represent callback uses into CallbackUses.
LLVM_NODISCARD bool empty() const
Value * getCallArgOperand(Argument &Arg) const
Return the operand of the underlying instruction associated with Arg.
const Use & getOperandUse(unsigned i) const
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
This defines the Use class.
The encoding of a callback with regards to the underlying instruction.
bool isIndirectCall() const
Return true if the callsite is an indirect call.
Value * getArgOperand(unsigned i) const
A Use represents the edge between a Value definition and its users.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
int getCallArgOperandNo(unsigned ArgNo) const
Return the operand index of the underlying instruction associated with the function parameter number ...
Value * getCalledOperand() const
ParameterEncodingTy ParameterEncoding
Value * getCalledOperand() const
Return the pointer to function that is being called.
void forEachCallbackFunction(const CallBase &CB, UnaryFunction Func)
Apply function Func to each CB's callback function.
bool isIndirectCall() const
Return true if this ACS represents an indirect call.
Function * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
unsigned getArgOperandNo(const Use *U) const
Given a use for a arg operand, get the arg operand number that corresponds to it.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
bool isCallee(Value::const_user_iterator UI) const
Return true if UI is the use that defines the callee of this ACS.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
unsigned getNumArgOperands() const
Return the number of parameters of the callee.
bool isCallee(Value::const_user_iterator UI) const
Determine whether the passed iterator points to the callee operand's Use.
bool isCallbackCall() const
Return true if this ACS represents a callback call.
void forEachCallbackCallSite(const CallBase &CB, UnaryFunction Func)
Apply function Func to each CB's callback call site.
int getCallArgOperandNoForCallee() const
Return the operand index of the underlying instruction associated with the callee of this ACS.
user_iterator_impl< const User > const_user_iterator
unsigned getNumArgOperands() const
AbstractCallSite(const Use *U)
Sole constructor for abstract call sites (ACS).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Value * getCallArgOperand(unsigned ArgNo) const
Return the operand of the underlying instruction associated with the function parameter number ArgNo ...
LLVM Value Representation.
CallBase * getInstruction() const
Return the underlying instruction.
const Use & getCalleeUseForCallback() const
Return the use of the callee value in the underlying instruction.
bool isDirectCall() const
Return true if this ACS represents a direct call.