[LoopAccesses] Cache the result of canVectorizeMemory

LAA will be an on-demand analysis pass, so we need to cache the result
of the analysis.  canVectorizeMemory is renamed to analyzeLoop which
computes the result.  canVectorizeMemory becomes the query function for
the cached result.

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@229892 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adam Nemet
2015-02-19 19:15:00 +00:00
parent 7b507eb2a5
commit 093a04b6d6
3 changed files with 31 additions and 18 deletions

View File

@ -3807,11 +3807,11 @@ void LoopVectorizationLegality::collectLoopUniforms() {
}
bool LoopVectorizationLegality::canVectorizeMemory() {
bool Success = LAI.canVectorizeMemory(Strides);
LAI.analyzeLoop(Strides);
auto &OptionalReport = LAI.getReport();
if (OptionalReport)
emitAnalysis(*OptionalReport);
return Success;
return LAI.canVectorizeMemory();
}
static bool hasMultipleUsesOf(Instruction *I,