OSDN Git Service

[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)
commit718b0230335beb99518719ca3af81d3cdec9e864
treea6ae3d1bfbb197a5c9b593c33b23aaf7a53cea3a
parent0d1e8dd84e4215e46e571e4249111da9928f78c3
[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@229626 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