diff options
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 7f4503f7a37..cff78839b62 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -1492,8 +1492,8 @@ bool LoopAccessInfo::canAnalyzeLoop() { } // ScalarEvolution needs to be able to find the exit count. - const SCEV *ExitCount = PSE.getBackedgeTakenCount(); - if (ExitCount == PSE.getSE()->getCouldNotCompute()) { + const SCEV *ExitCount = PSE->getBackedgeTakenCount(); + if (ExitCount == PSE->getSE()->getCouldNotCompute()) { emitAnalysis(LoopAccessReport() << "could not determine number of loop iterations"); DEBUG(dbgs() << "LAA: SCEV could not compute the loop exit count.\n"); @@ -1598,7 +1598,7 @@ void LoopAccessInfo::analyzeLoop() { MemoryDepChecker::DepCandidates DependentAccesses; AccessAnalysis Accesses(TheLoop->getHeader()->getModule()->getDataLayout(), - AA, LI, DependentAccesses, PSE); + AA, LI, DependentAccesses, *PSE); // Holds the analyzed pointers. We don't want to call GetUnderlyingObjects // multiple times on the same object. If the ptr is accessed twice, once @@ -1647,7 +1647,7 @@ void LoopAccessInfo::analyzeLoop() { // words may be written to the same address. bool IsReadOnlyPtr = false; if (Seen.insert(Ptr).second || - !getPtrStride(PSE, Ptr, TheLoop, SymbolicStrides)) { + !getPtrStride(*PSE, Ptr, TheLoop, SymbolicStrides)) { ++NumReads; IsReadOnlyPtr = true; } @@ -1676,7 +1676,7 @@ void LoopAccessInfo::analyzeLoop() { // Find pointers with computable bounds. We are going to use this information // to place a runtime bound check. - bool CanDoRTIfNeeded = Accesses.canCheckPtrAtRT(*PtrRtChecking, PSE.getSE(), + bool CanDoRTIfNeeded = Accesses.canCheckPtrAtRT(*PtrRtChecking, PSE->getSE(), TheLoop, SymbolicStrides); if (!CanDoRTIfNeeded) { emitAnalysis(LoopAccessReport() << "cannot identify array bounds"); @@ -1704,7 +1704,7 @@ void LoopAccessInfo::analyzeLoop() { PtrRtChecking->reset(); PtrRtChecking->Need = true; - auto *SE = PSE.getSE(); + auto *SE = PSE->getSE(); CanDoRTIfNeeded = Accesses.canCheckPtrAtRT(*PtrRtChecking, SE, TheLoop, SymbolicStrides, true); @@ -1751,7 +1751,7 @@ void LoopAccessInfo::emitAnalysis(LoopAccessReport &Message) { } bool LoopAccessInfo::isUniform(Value *V) const { - return (PSE.getSE()->isLoopInvariant(PSE.getSE()->getSCEV(V), TheLoop)); + return (PSE->getSE()->isLoopInvariant(PSE->getSE()->getSCEV(V), TheLoop)); } // FIXME: this function is currently a duplicate of the one in @@ -1832,8 +1832,8 @@ std::pair<Instruction *, Instruction *> LoopAccessInfo::addRuntimeChecks( Instruction *Loc, const SmallVectorImpl<RuntimePointerChecking::PointerCheck> &PointerChecks) const { - auto *SE = PSE.getSE(); - SCEVExpander Exp(*SE, DL, "induction"); + auto *SE = PSE->getSE(); + SCEVExpander Exp(*SE, *DL, "induction"); auto ExpandedChecks = expandBounds(PointerChecks, TheLoop, Loc, SE, Exp, *PtrRtChecking); @@ -1906,7 +1906,7 @@ void LoopAccessInfo::collectStridedAccess(Value *MemAccess) { else return; - Value *Stride = getStrideFromPointer(Ptr, PSE.getSE(), TheLoop); + Value *Stride = getStrideFromPointer(Ptr, PSE->getSE(), TheLoop); if (!Stride) return; @@ -1920,10 +1920,10 @@ LoopAccessInfo::LoopAccessInfo(Loop *L, ScalarEvolution *SE, const DataLayout &DL, const TargetLibraryInfo *TLI, AliasAnalysis *AA, DominatorTree *DT, LoopInfo *LI) - : PSE(*SE, *L), + : PSE(llvm::make_unique<PredicatedScalarEvolution>(*SE, *L)), PtrRtChecking(llvm::make_unique<RuntimePointerChecking>(SE)), - DepChecker(llvm::make_unique<MemoryDepChecker>(PSE, L)), TheLoop(L), - DL(DL), TLI(TLI), AA(AA), DT(DT), LI(LI), NumLoads(0), NumStores(0), + DepChecker(llvm::make_unique<MemoryDepChecker>(*PSE, L)), TheLoop(L), + DL(&DL), TLI(TLI), AA(AA), DT(DT), LI(LI), NumLoads(0), NumStores(0), MaxSafeDepDistBytes(-1U), CanVecMem(false), StoreToLoopInvariantAddress(false) { if (canAnalyzeLoop()) @@ -1962,12 +1962,12 @@ void LoopAccessInfo::print(raw_ostream &OS, unsigned Depth) const { << "found in loop.\n"; OS.indent(Depth) << "SCEV assumptions:\n"; - PSE.getUnionPredicate().print(OS, Depth); + PSE->getUnionPredicate().print(OS, Depth); OS << "\n"; OS.indent(Depth) << "Expressions re-written:\n"; - PSE.print(OS, Depth); + PSE->print(OS, Depth); } const LoopAccessInfo &LoopAccessAnalysis::getInfo(Loop *L) { |