[all-commits] [llvm/llvm-project] d99a18: [BasicAA] Use known lower bounds for index values ...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Sat May 30 08:47:39 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: d99a1848c4f8ca164c0c0768e10eafc850b2a68a
https://github.com/llvm/llvm-project/commit/d99a1848c4f8ca164c0c0768e10eafc850b2a68a
Author: Florian Hahn <flo at fhahn.com>
Date: 2020-05-30 (Sat, 30 May 2020)
Changed paths:
M llvm/include/llvm/Analysis/BasicAliasAnalysis.h
M llvm/lib/Analysis/BasicAliasAnalysis.cpp
M llvm/test/Analysis/BasicAA/assume-index-positive.ll
M llvm/test/Analysis/BasicAA/bug.23626.ll
Log Message:
-----------
[BasicAA] Use known lower bounds for index values for size based check.
Currently, BasicAA does not exploit information about value ranges of
indexes. For example, consider the 2 pointers %a = %base and
%b = %base + %stride below, assuming they are used to access 4 elements.
If we know that %stride >= 4, we know the accesses do not alias. If
%stride is a constant, BasicAA currently gets that. But if the >= 4
constraint is encoded using an assume, it misses the NoAlias.
This patch extends DecomposedGEP to include an additional MinOtherOffset
field, which tracks the constant offset similar to the existing
OtherOffset, which the difference that it also includes non-negative
lower bounds on the range of the index value. When checking if the
distance between 2 accesses exceeds the access size, we can use this
improved bound.
For now this is limited to using non-negative lower bounds for indices,
as this conveniently skips cases where we do not have a useful lower
bound (because it is not constrained). We potential miss out in cases
where the lower bound is constrained but negative, but that can be
exploited in the future.
Reviewers: sanjoy, hfinkel, reames, asbirlea
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D76194
More information about the All-commits
mailing list