[LoopAccesses] Create the analysis pass
authorAdam Nemet <anemet@apple.com>
Thu, 19 Feb 2015 19:15:04 +0000 (19:15 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 19 Feb 2015 19:15:04 +0000 (19:15 +0000)
commit3bfd93d78976290eeca5d2bd12870d42d279f050
treeaac1356332168df0ebbde92bdc4b00b129b60a5a
parent436018c3ffa219d69ca383284e4303107d9edcaf
[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: 229893
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