OSDN Git Service

[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)
commit0ea25c2e64c98d820a5cac6d5ce229a7d8f4e3e4
tree2c2c6772848fe4e353ea9a6a8c9a45029e21edd9
parent093a04b6d65acf24ffc066779cd26a1fce3bdfd0
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229893 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopAccessAnalysis.h
include/llvm/InitializePasses.h
lib/Analysis/LoopAccessAnalysis.cpp
lib/Transforms/Scalar/Scalar.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp