Follow uses to create value MemoryAccesses
commit7313aa576dc9327e7d68660c007a317bd498e372
authorMichael Kruse <llvm@meinersbur.de>
Sat, 6 Feb 2016 09:19:40 +0000 (6 09:19 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Sat, 6 Feb 2016 09:19:40 +0000 (6 09:19 +0000)
tree1e0042164af9e78e373b4eeb5a27a97b8d581404
parent419575163a8a4ea89bc88539ccb6ec2eb2751afb
Follow uses to create value MemoryAccesses

The previously implemented approach is to follow value definitions and
create write accesses ("push defs") while searching for uses. This
requires the same relatively validity- and requirement conditions to be
replicated at multiple locations (PHI instructions, other instructions,
uses by PHIs).

We replace this by iterating over the uses in a SCoP ("pull in
requirements"), and add writes only when at least one read has been
added. It turns out to be simpler code because each use is only iterated
over once and writes are added for the first access that reads it. We
need another iteration to identify escaping values (uses not in the
SCoP), which also makes the difference between such accesses more
obvious. As a side-effect, the order of scalar MemoryAccess can change.

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

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@259987 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/polly/ScopInfo.h
include/polly/Support/ScopHelper.h
lib/Analysis/ScopInfo.cpp
lib/Support/ScopHelper.cpp
test/Isl/CodeGen/MemAccess/update_access_functions.ll
test/Isl/CodeGen/invariant_load_scalar_escape_alloca_sharing.ll
test/ScopInfo/invariant-loads-leave-read-only-statements.ll
test/ScopInfo/many-scalar-dependences.ll
test/ScopInfo/multidim_fortran_srem.ll
test/ScopInfo/non_affine_region_4.ll
test/ScopInfo/phi_condition_modeling_2.ll
test/ScopInfo/phi_loop_carried_float.ll
test/ScopInfo/phi_scalar_simple_1.ll
test/ScopInfo/phi_scalar_simple_2.ll
test/ScopInfo/scalar.ll
test/ScopInfo/tempscop-printing.ll