28 for (
const Use &U : FPtr->
uses()) {
38 if (isa<BitCastInst>(User)) {
41 }
else if (
auto CI = dyn_cast<CallInst>(User)) {
43 }
else if (
auto II = dyn_cast<InvokeInst>(User)) {
45 }
else if (HasNonCallUses) {
46 *HasNonCallUses =
true;
55 for (
const Use &U : VPtr->
uses()) {
57 if (isa<BitCastInst>(User)) {
59 }
else if (isa<LoadInst>(User)) {
61 }
else if (
auto GEP = dyn_cast<GetElementPtrInst>(User)) {
63 if (VPtr ==
GEP->getPointerOperand() &&
GEP->hasAllConstantIndices()) {
66 GEP->getSourceElementType(), Indices);
83 for (
const Use &CIU : CI->
uses()) {
84 if (
auto *AssumeCI = dyn_cast<CallInst>(CIU.getUser())) {
85 Function *
F = AssumeCI->getCalledFunction();
108 HasNonCallUses =
true;
112 for (
const Use &U : CI->
uses()) {
113 auto CIU = U.getUser();
114 if (
auto EVI = dyn_cast<ExtractValueInst>(CIU)) {
115 if (EVI->getNumIndices() == 1 && EVI->getIndices()[0] == 0) {
119 if (EVI->getNumIndices() == 1 && EVI->getIndices()[0] == 1) {
124 HasNonCallUses =
true;
127 for (
Value *LoadedPtr : LoadedPtrs)
129 Offset->getZExtValue(), CI, DT);
iterator_range< use_iterator > uses()
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
void findDevirtualizableCallsForTypeTest(SmallVectorImpl< DevirtCallSite > &DevirtCalls, SmallVectorImpl< CallInst *> &Assumes, const CallInst *CI, DominatorTree &DT)
Given a call to the intrinsic @llvm.type.test, find all devirtualizable call sites based on the call ...
void push_back(const T &Elt)
This class represents a function call, abstracting a target machine's calling convention.
Value * getArgOperand(unsigned i) const
void findDevirtualizableCallsForTypeCheckedLoad(SmallVectorImpl< DevirtCallSite > &DevirtCalls, SmallVectorImpl< Instruction *> &LoadedPtrs, SmallVectorImpl< Instruction *> &Preds, bool &HasNonCallUses, const CallInst *CI, DominatorTree &DT)
Given a call to the intrinsic @llvm.type.checked.load, find all devirtualizable call sites based on t...
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
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...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
This is the shared class of boolean and integer constants.
bool dominates(const Instruction *Def, const Use &U) const
Return true if Def dominates a use in User.
Module.h This file contains the declarations for the Module class.
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
LLVM_NODISCARD bool empty() const
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
const Function * getParent() const
Return the enclosing method, or null if none.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
int64_t getIndexedOffsetInType(Type *ElemTy, ArrayRef< Value *> Indices) const
Returns the offset from the beginning of the type for the specified indices.
const BasicBlock * getParent() const