Go to the documentation of this file.
41 bool ProvenanceAnalysis::relatedSelect(
const SelectInst *A,
46 if (
A->getCondition() == SB->getCondition())
47 return related(
A->getTrueValue(), SB->getTrueValue()) ||
48 related(
A->getFalseValue(), SB->getFalseValue());
54 bool ProvenanceAnalysis::relatedPHI(
const PHINode *A,
59 if (
const PHINode *PNB = dyn_cast<PHINode>(
B))
60 if (PNB->getParent() ==
A->getParent()) {
61 for (
unsigned i = 0,
e =
A->getNumIncomingValues();
i !=
e; ++
i)
63 PNB->getIncomingValueForBlock(
A->getIncomingBlock(
i))))
70 for (
Value *PV1 :
A->incoming_values()) {
84 Worklist.push_back(
P);
88 for (
const Use &U :
P->uses()) {
89 const User *Ur = U.getUser();
90 if (isa<StoreInst>(Ur)) {
91 if (U.getOperandNo() == 0)
97 if (isa<CallInst>(Ur))
100 if (isa<PtrToIntInst>(
P))
103 if (Visited.
insert(Ur).second)
104 Worklist.push_back(Ur);
106 }
while (!Worklist.empty());
112 bool ProvenanceAnalysis::relatedCheck(
const Value *A,
const Value *
B) {
114 switch (
AA->alias(A,
B)) {
130 if (isa<LoadInst>(
B))
134 if (isa<LoadInst>(A))
139 }
else if (BIsIdentified) {
141 if (isa<LoadInst>(A))
146 if (
const PHINode *PN = dyn_cast<PHINode>(A))
147 return relatedPHI(PN,
B);
148 if (
const PHINode *PN = dyn_cast<PHINode>(
B))
149 return relatedPHI(PN, A);
151 return relatedSelect(
S,
B);
153 return relatedSelect(
S, A);
171 std::pair<CachedResultsTy::iterator, bool> Pair =
172 CachedResults.
insert(std::make_pair(ValuePairTy(A,
B),
true));
174 return Pair.first->second;
176 bool Result = relatedCheck(A,
B);
177 CachedResults[ValuePairTy(A,
B)] = Result;
@ MayAlias
The two locations may or may not alias.
@ PartialAlias
The two locations alias, but only due to a partial overlap.
This is an optimization pass for GlobalISel generic memory operations.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
LLVM_NODISCARD T pop_back_val()
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const Value * GetUnderlyingObjCPtrCached(const Value *V, DenseMap< const Value *, std::pair< WeakVH, WeakTrackingVH >> &Cache)
A wrapper for GetUnderlyingObjCPtr used for results memoization.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
This class represents the LLVM 'select' instruction.
bool IsObjCIdentifiedObject(const Value *V)
Return true if this value refers to a distinct and identifiable object.
@ NoAlias
The two locations do not alias at all.
@ MustAlias
The two locations precisely alias each other.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
static bool IsStoredObjCPointer(const Value *P)
Test if the value of P, or any value covered by its provenance, is ever stored within the function (n...
bool related(const Value *A, const Value *B)
LLVM Value Representation.
A Use represents the edge between a Value definition and its users.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.