summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-07-13 22:18:51 +0000
committerAdam Nemet <anemet@apple.com>2016-07-13 22:18:51 +0000
commit1824e411c6e2eee5b0517492a0f1ac267eea7b27 (patch)
treeaa30913d95c2e6c05d6c64d69a0253098f8ce6de /llvm/lib
parent6616ad08f6990db2b4ce09416042e8eb3255328c (diff)
downloadbcm5719-llvm-1824e411c6e2eee5b0517492a0f1ac267eea7b27.tar.gz
bcm5719-llvm-1824e411c6e2eee5b0517492a0f1ac267eea7b27.zip
[LAA] Don't hold on to DataLayout in the analysis result
In fact, don't even pass this to the ctor since we can get it from the module. llvm-svn: 275326
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index b092a1a39c2..4f0d8ad2734 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1830,8 +1830,9 @@ std::pair<Instruction *, Instruction *> LoopAccessInfo::addRuntimeChecks(
Instruction *Loc,
const SmallVectorImpl<RuntimePointerChecking::PointerCheck> &PointerChecks)
const {
+ const DataLayout &DL = TheLoop->getHeader()->getModule()->getDataLayout();
auto *SE = PSE->getSE();
- SCEVExpander Exp(*SE, *DL, "induction");
+ SCEVExpander Exp(*SE, DL, "induction");
auto ExpandedChecks =
expandBounds(PointerChecks, TheLoop, Loc, SE, Exp, *PtrRtChecking);
@@ -1915,15 +1916,13 @@ void LoopAccessInfo::collectStridedAccess(Value *MemAccess) {
}
LoopAccessInfo::LoopAccessInfo(Loop *L, ScalarEvolution *SE,
- const DataLayout &DL,
const TargetLibraryInfo *TLI, AliasAnalysis *AA,
DominatorTree *DT, LoopInfo *LI)
: 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), DT(DT), NumLoads(0), NumStores(0),
- MaxSafeDepDistBytes(-1), CanVecMem(false),
- StoreToLoopInvariantAddress(false) {
+ TLI(TLI), DT(DT), NumLoads(0), NumStores(0), MaxSafeDepDistBytes(-1),
+ CanVecMem(false), StoreToLoopInvariantAddress(false) {
if (canAnalyzeLoop())
analyzeLoop(AA, LI);
}
@@ -1971,10 +1970,9 @@ void LoopAccessInfo::print(raw_ostream &OS, unsigned Depth) const {
const LoopAccessInfo &LoopAccessLegacyAnalysis::getInfo(Loop *L) {
auto &LAI = LoopAccessInfoMap[L];
- if (!LAI) {
- const DataLayout &DL = L->getHeader()->getModule()->getDataLayout();
- LAI = llvm::make_unique<LoopAccessInfo>(L, SE, DL, TLI, AA, DT, LI);
- }
+ if (!LAI)
+ LAI = llvm::make_unique<LoopAccessInfo>(L, SE, TLI, AA, DT, LI);
+
return *LAI.get();
}
@@ -2040,8 +2038,7 @@ LoopAccessInfo LoopAccessAnalysis::run(Loop &L, AnalysisManager<Loop> &AM) {
report_fatal_error("DominatorTree must have been cached at a higher level");
if (!LI)
report_fatal_error("LoopInfo must have been cached at a higher level");
- const DataLayout &DL = F.getParent()->getDataLayout();
- return LoopAccessInfo(&L, SE, DL, TLI, AA, DT, LI);
+ return LoopAccessInfo(&L, SE, TLI, AA, DT, LI);
}
PreservedAnalyses LoopAccessInfoPrinterPass::run(Loop &L,
OpenPOWER on IntegriCloud