From eb11fae6d08f479c0799db45860a98af528fa6e7 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 28 Jul 2018 10:51:19 +0000 Subject: Vendor import of llvm trunk r338150: https://llvm.org/svn/llvm-project/llvm/trunk@338150 --- lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp') diff --git a/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp b/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp index f89fc8eb62aa..3004fffb9745 100644 --- a/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp +++ b/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. -- cgit v1.2.3