diff options
| author | Adam Nemet <anemet@apple.com> | 2015-02-19 19:14:56 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2015-02-19 19:14:56 +0000 |
| commit | c922853b931869e9c76ed06395add273c3af102a (patch) | |
| tree | 2b99c017a8502e4dd53ffe4747f5880c6b4f49f9 /llvm/lib | |
| parent | f219c6472355e0b5d207281e1fb19031c90998d2 (diff) | |
| download | bcm5719-llvm-c922853b931869e9c76ed06395add273c3af102a.tar.gz bcm5719-llvm-c922853b931869e9c76ed06395add273c3af102a.zip | |
[LoopAccesses] Stash the report from the analysis rather than emitting it
The transformation passes will query this and then emit them as part of
their own report. The currently only user LV is modified to do just
that.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229891
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index c0cad5c0894..8d64553d1de 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -1120,7 +1120,8 @@ bool LoopAccessInfo::blockNeedsPredication(BasicBlock *BB, Loop *TheLoop, } void LoopAccessInfo::emitAnalysis(VectorizationReport &Message) { - VectorizationReport::emitAnalysis(Message, TheFunction, TheLoop); + assert(!Report && "Multiple reports generated"); + Report = Message; } bool LoopAccessInfo::isUniform(Value *V) { diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index f53c913c647..8b671355ebd 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -535,7 +535,7 @@ public: : NumPredStores(0), TheLoop(L), SE(SE), DL(DL), TLI(TLI), TheFunction(F), TTI(TTI), DT(DT), Induction(nullptr), WidestIndTy(nullptr), - LAI(F, L, SE, DL, TLI, AA, DT), + LAI(L, SE, DL, TLI, AA, DT), HasFunNoNaNAttr(false) {} /// This enum represents the kinds of reductions that we support. @@ -3807,7 +3807,11 @@ void LoopVectorizationLegality::collectLoopUniforms() { } bool LoopVectorizationLegality::canVectorizeMemory() { - return LAI.canVectorizeMemory(Strides); + bool Success = LAI.canVectorizeMemory(Strides); + auto &OptionalReport = LAI.getReport(); + if (OptionalReport) + emitAnalysis(*OptionalReport); + return Success; } static bool hasMultipleUsesOf(Instruction *I, |

