From b60295a525436a16601b5f6c07fe3bd5469de695 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Tue, 3 Feb 2015 17:59:53 +0000 Subject: [PATCH] [LoopVectorize] Fix rebase glitch in r227751 LoopVectorizationLegality::{getNumLoads,getNumStores} should forward to LoopAccessAnalysis now. Thanks to Takumi for noticing this! llvm-svn: 227992 --- llvm/include/llvm/Analysis/LoopAccessAnalysis.h | 4 +++- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h index b50aacf..7e4b9d7 100644 --- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h +++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h @@ -159,7 +159,9 @@ public: /// Returns true if the value V is uniform within the loop. bool isUniform(Value *V); - unsigned getMaxSafeDepDistBytes() { return MaxSafeDepDistBytes; } + unsigned getMaxSafeDepDistBytes() const { return MaxSafeDepDistBytes; } + unsigned getNumStores() const { return NumStores; } + unsigned getNumLoads() const { return NumLoads;} private: void emitAnalysis(VectorizationReport &Message); diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index e6d8371..8d0c817 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -555,7 +555,7 @@ public: DominatorTree *DT, TargetLibraryInfo *TLI, AliasAnalysis *AA, Function *F, const TargetTransformInfo *TTI) - : NumLoads(0), NumStores(0), NumPredStores(0), TheLoop(L), SE(SE), DL(DL), + : NumPredStores(0), TheLoop(L), SE(SE), DL(DL), TLI(TLI), TheFunction(F), TTI(TTI), Induction(nullptr), WidestIndTy(nullptr), LAA(F, L, SE, DL, TLI, AA, DT, @@ -780,10 +780,10 @@ public: return (MaskedOp.count(I) != 0); } unsigned getNumStores() const { - return NumStores; + return LAA.getNumStores(); } unsigned getNumLoads() const { - return NumLoads; + return LAA.getNumLoads(); } unsigned getNumPredStores() const { return NumPredStores; @@ -842,8 +842,6 @@ private: VectorizationReport::emitAnalysis(Message, TheFunction, TheLoop); } - unsigned NumLoads; - unsigned NumStores; unsigned NumPredStores; /// The loop that we evaluate. -- 2.7.4