diff options
author | Vedant Kumar <vsk@apple.com> | 2016-05-11 15:45:43 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-05-11 15:45:43 +0000 |
commit | ee20294af55e73f12829aefd0b6519cf81efe93d (patch) | |
tree | 77be1cf4e8cecb08ca9aca9adbc6daad5f2aeb99 /llvm/lib/Analysis | |
parent | 45533b4060c781a7925faec9f9a933e568e0480b (diff) | |
download | bcm5719-llvm-ee20294af55e73f12829aefd0b6519cf81efe93d.tar.gz bcm5719-llvm-ee20294af55e73f12829aefd0b6519cf81efe93d.zip |
[BasicAA] Compare GEP indices based on value (Fix PR27418)
Equivalent GEP indices with different types are treated as different
indices altogether, leading to an incorrect AA result. Fix the issue
by comparing indices based on their values.
Thanks to Mikael Holmén for reporting the issue!
Differential Revision: http://reviews.llvm.org/D19935
llvm-svn: 269197
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 0b5c85813b4..73dc0457ea8 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -847,7 +847,7 @@ static AliasResult aliasSameBasePointerGEPs(const GEPOperator *GEP1, // If the last (struct) indices are constants and are equal, the other indices // might be also be dynamically equal, so the GEPs can alias. - if (C1 && C2 && C1 == C2) + if (C1 && C2 && C1->getSExtValue() == C2->getSExtValue()) return MayAlias; // Find the last-indexed type of the GEP, i.e., the type you'd get if |