[LAA] Merge memchecks for accesses separated by a constant offset
authorSilviu Baranga <silviu.baranga@arm.com>
Wed, 8 Jul 2015 09:16:33 +0000 (09:16 +0000)
committerSilviu Baranga <silviu.baranga@arm.com>
Wed, 8 Jul 2015 09:16:33 +0000 (09:16 +0000)
commit8bde8570885989556d8f333a219f073a6dbdcb1d
tree53c97650d1f42f3d4d62843c1c3d24b1541cad3b
parent796a06d4eb49fd8b99973790951e4cf9d15513ad
[LAA] Merge memchecks for accesses separated by a constant offset

Summary:
Often filter-like loops will do memory accesses that are
separated by constant offsets. In these cases it is
common that we will exceed the threshold for the
allowable number of checks.

However, it should be possible to merge such checks,
sice a check of any interval againt two other intervals separated
by a constant offset (a,b), (a+c, b+c) will be equivalent with
a check againt (a, b+c), as long as (a,b) and (a+c, b+c) overlap.
Assuming the loop will be executed for a sufficient number of
iterations, this will be true. If not true, checking against
(a, b+c) is still safe (although not equivalent).

As long as there are no dependencies between two accesses,
we can merge their checks into a single one. We use this
technique to construct groups of accesses, and then check
the intervals associated with the groups instead of
checking the accesses directly.

Reviewers: anemet

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10386

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241673 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopAccessAnalysis.h
lib/Analysis/LoopAccessAnalysis.cpp
test/Analysis/LoopAccessAnalysis/number-of-memchecks.ll
test/Analysis/LoopAccessAnalysis/resort-to-memchecks-only.ll
test/Analysis/LoopAccessAnalysis/unsafe-and-rt-checks.ll
test/Transforms/LoopDistribute/basic-with-memchecks.ll