diff options
author | Michael Kuperstein <mkuper@google.com> | 2016-05-20 20:55:51 +0000 |
---|---|---|
committer | Michael Kuperstein <mkuper@google.com> | 2016-05-20 20:55:51 +0000 |
commit | c6de57e47a3898559593d2cdfff635e0ade80f62 (patch) | |
tree | 6c311fb76466440da225b5d07434c5eed4e33c18 /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 54acedf88f8358a687c75db8352782554639cc63 (diff) | |
download | bcm5719-llvm-c6de57e47a3898559593d2cdfff635e0ade80f62.tar.gz bcm5719-llvm-c6de57e47a3898559593d2cdfff635e0ade80f62.zip |
Revert r270268 due to unused variable warnings.
llvm-svn: 270272
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 876ffe05d83..be4e8e972d0 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -991,10 +991,13 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, const Value *GEP1BasePtr = DecomposeGEPExpression(GEP1, GEP1BaseOffset, GEP1VariableIndices, GEP1MaxLookupReached, DL, &AC, DT); - - assert(GEP1BasePtr == UnderlyingV1 && GEP2BasePtr == UnderlyingV2 && - "DecomposeGEPExpression returned a result different from " - "GetUnderlyingObject"); + // DecomposeGEPExpression and GetUnderlyingObject should return the + // same result except when DecomposeGEPExpression has no DataLayout. + // FIXME: They always have a DataLayout, so this should become an + // assert. + if (GEP1BasePtr != UnderlyingV1 || GEP2BasePtr != UnderlyingV2) { + return MayAlias; + } // If the max search depth is reached the result is undefined if (GEP2MaxLookupReached || GEP1MaxLookupReached) return MayAlias; @@ -1026,10 +1029,12 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, DecomposeGEPExpression(GEP2, GEP2BaseOffset, GEP2VariableIndices, GEP2MaxLookupReached, DL, &AC, DT); - assert(GEP1BasePtr == UnderlyingV1 && GEP2BasePtr == UnderlyingV2 && - "DecomposeGEPExpression returned a result different from " - "GetUnderlyingObject"); - + // DecomposeGEPExpression and GetUnderlyingObject should return the + // same result except when DecomposeGEPExpression has no DataLayout. + // FIXME: They always have a DataLayout, so this should become an assert. + if (GEP1BasePtr != UnderlyingV1 || GEP2BasePtr != UnderlyingV2) { + return MayAlias; + } // If we know the two GEPs are based off of the exact same pointer (and not // just the same underlying object), see if that tells us anything about @@ -1076,10 +1081,10 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, // DecomposeGEPExpression and GetUnderlyingObject should return the // same result except when DecomposeGEPExpression has no DataLayout. - assert(GEP1BasePtr == UnderlyingV1 && - "DecomposeGEPExpression returned a result different from " - "GetUnderlyingObject"); - + // FIXME: They always have a DataLayout, so this should become an assert. + if (GEP1BasePtr != UnderlyingV1) { + return MayAlias; + } // If the max search depth is reached the result is undefined if (GEP1MaxLookupReached) return MayAlias; |