summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp')
-rw-r--r--llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp b/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp
index f89fc8eb62a..3004fffb974 100644
--- a/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp
@@ -115,14 +115,6 @@ static bool IsStoredObjCPointer(const Value *P) {
bool ProvenanceAnalysis::relatedCheck(const Value *A, const Value *B,
const DataLayout &DL) {
- // Skip past provenance pass-throughs.
- A = GetUnderlyingObjCPtr(A, DL);
- B = GetUnderlyingObjCPtr(B, DL);
-
- // Quick check.
- if (A == B)
- return true;
-
// Ask regular AliasAnalysis, for a first approximation.
switch (AA->alias(A, B)) {
case NoAlias:
@@ -171,6 +163,13 @@ bool ProvenanceAnalysis::relatedCheck(const Value *A, const Value *B,
bool ProvenanceAnalysis::related(const Value *A, const Value *B,
const DataLayout &DL) {
+ A = GetUnderlyingObjCPtrCached(A, DL, UnderlyingObjCPtrCache);
+ B = GetUnderlyingObjCPtrCached(B, DL, UnderlyingObjCPtrCache);
+
+ // Quick check.
+ if (A == B)
+ return true;
+
// Begin by inserting a conservative value into the map. If the insertion
// fails, we have the answer already. If it succeeds, leave it there until we
// compute the real answer to guard against recursive queries.
OpenPOWER on IntegriCloud