diff options
author | Florian Hahn <flo@fhahn.com> | 2019-12-12 17:10:43 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-12-12 17:18:04 +0000 |
commit | bd12a322d7e0b2541880c00f5551e047e06be982 (patch) | |
tree | 8f9c92635b2348cb1e8219a03e08a047cf4365db /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | a4304f96d6baba92baa9db1eef0ed647f76306f6 (diff) | |
download | bcm5719-llvm-bd12a322d7e0b2541880c00f5551e047e06be982.tar.gz bcm5719-llvm-bd12a322d7e0b2541880c00f5551e047e06be982.zip |
[BasicAA] Use GEP as context for computeKnownBits in aliasGEP.
In order to use assumptions, computeKnownBits needs a context
instruction. We can use the GEP, if it is an instruction. We already
pass the assumption cache, but it cannot be used without a context
instruction.
Reviewers: anemet, asbirlea, hfinkel, spatel
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D71264
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 227b12d1b67..e852d663c6b 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -1482,7 +1482,8 @@ AliasResult BasicAAResult::aliasGEP( // give up if we can't determine conditions that hold for every cycle: const Value *V = DecompGEP1.VarIndices[i].V; - KnownBits Known = computeKnownBits(V, DL, 0, &AC, nullptr, DT); + KnownBits Known = + computeKnownBits(V, DL, 0, &AC, dyn_cast<Instruction>(GEP1), DT); bool SignKnownZero = Known.isNonNegative(); bool SignKnownOne = Known.isNegative(); |