[LoopAccesses] Create the analysis pass
authorAdam Nemet <anemet@apple.com>
Wed, 18 Feb 2015 03:43:24 +0000 (03:43 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 18 Feb 2015 03:43:24 +0000 (03:43 +0000)
commitd6b7e29815d209ade369c349c500c65ff9caa342
tree2365bebef1318ed9a989d9c9a9be620737707cca
parent01abb2c35536d13f660d90ebffc8d2e536f0cb87
[LoopAccesses] Create the analysis pass

This is a function pass that runs the analysis on demand.  The analysis
can be initiated by querying the loop access info via LAA::getInfo.  It
either returns the cached info or runs the analysis.

Symbolic stride information continues to reside outside of this analysis
pass. We may move it inside later but it's not a priority for me right
now.  The idea is that Loop Distribution won't support run-time stride
checking at least initially.

This means that when querying the analysis, symbolic stride information
can be provided optionally.  Whether stride information is used can
invalidate the cache entry and rerun the analysis.  Note that if the
loop does not have any symbolic stride, the entry should be preserved
across Loop Distribution and LV.

Since currently the only user of the pass is LV, I just check that the
symbolic stride information didn't change when using a cached result.

On the LV side, LoopVectorizationLegality requests the info object
corresponding to the loop from the analysis pass.  A large chunk of the
diff is due to LAI becoming a pointer from a reference.

A test will be added as part of the -analyze patch.

Also tested that with AVX, we generate identical assembly output for the
testsuite (including the external testsuite) before and after.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229626
llvm/include/llvm/Analysis/LoopAccessAnalysis.h
llvm/include/llvm/InitializePasses.h
llvm/lib/Analysis/LoopAccessAnalysis.cpp
llvm/lib/Transforms/Scalar/Scalar.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp