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)
commitcf928cb53f3eb110c12d58081f455ad4ffeb06a7
treec5792986e3cb775901f4e630e981a1c0b4e88d6d
parent3cbec0f73d0723cf41718206fe4949495b119c03
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.

llvm-svn: 175818
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/global_alias.ll [new file with mode: 0644]