Allow GlobalValues to vectorize with AliasAnalysis
authorRenato Golin <renato.golin@linaro.org>
Thu, 21 Feb 2013 22:39:03 +0000 (22:39 +0000)
committerRenato Golin <renato.golin@linaro.org>
Thu, 21 Feb 2013 22:39:03 +0000 (22:39 +0000)
commite18bce5317ff9f64b3c02418f28c6d383d88b294
tree8754e498c5d99a07c1ee0ea67a7d8d3dc933098e
parentb489e29976afed1a015eecd00c5726fe565b038c
Allow GlobalValues to vectorize with AliasAnalysis

Storing the load/store instructions with the values
and inspect them using Alias Analysis to make sure
they don't alias, since the GEP pointer operand doesn't
take the offset into account.

Trying hard to not add any extra cost to loads and stores
that don't overlap on global values, AA is *only* calculated
if all of the previous attempts failed.

Using biggest vector register size as the stride for the
vectorization access, as we're being conservative and
the cost model (which calculates the real vectorization
factor) is only run after the legalization phase.

We might re-think this relationship in the future, but
for now, I'd rather be safe than sorry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175818 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/global_alias.ll [new file with mode: 0644]