diff options
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 3e22ce8..caa0635 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -1098,22 +1098,6 @@ AliasResult BasicAAResult::aliasGEP( const GEPOperator *GEP1, LocationSize V1Size, const AAMDNodes &V1AAInfo, const Value *V2, LocationSize V2Size, const AAMDNodes &V2AAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2, AAQueryInfo &AAQI) { - // If both accesses are unknown size, we can only check whether the - // underlying objects are different. - if (!V1Size.hasValue() && !V2Size.hasValue()) { - // If the other operand is a phi/select, let phi/select handling perform - // this check. Otherwise the same recursive walk is done twice. - if (!isa<PHINode>(V2) && !isa<SelectInst>(V2)) { - AliasResult BaseAlias = - aliasCheck(UnderlyingV1, LocationSize::beforeOrAfterPointer(), - AAMDNodes(), UnderlyingV2, - LocationSize::beforeOrAfterPointer(), AAMDNodes(), AAQI); - if (BaseAlias == NoAlias) - return NoAlias; - } - return MayAlias; - } - DecomposedGEP DecompGEP1 = DecomposeGEPExpression(GEP1, DL, &AC, DT); DecomposedGEP DecompGEP2 = DecomposeGEPExpression(V2, DL, &AC, DT); @@ -1172,6 +1156,10 @@ AliasResult BasicAAResult::aliasGEP( // instruction. If one pointer is a GEP with a non-zero index of the other // pointer, we know they cannot alias. + // If both accesses are unknown size, we can't do anything useful here. + if (!V1Size.hasValue() && !V2Size.hasValue()) + return MayAlias; + AliasResult R = aliasCheck( UnderlyingV1, LocationSize::beforeOrAfterPointer(), AAMDNodes(), V2, V2Size, V2AAInfo, AAQI, nullptr, UnderlyingV2); |