aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2022-08-25 21:40:21 +0100
committerFlorian Hahn <flo@fhahn.com>2022-08-25 21:40:22 +0100
commitc035efc814e6eba4fe3030260fdab64f56d7f1d0 (patch)
tree0a169906e8846674a5683a86d6e5b245233d5d22 /llvm/lib/Analysis/LoopAccessAnalysis.cpp
parentcaaafe4ae250cdb24d69e0478710b2a01844ee7e (diff)
downloadllvm-c035efc814e6eba4fe3030260fdab64f56d7f1d0.zip
llvm-c035efc814e6eba4fe3030260fdab64f56d7f1d0.tar.gz
llvm-c035efc814e6eba4fe3030260fdab64f56d7f1d0.tar.bz2
[LAA] Cache PSE.getSE() in variable (NFC).
Preparation for follow-up patches will introduce additional uses of SE.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index a9a4a82..a95b432 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1854,7 +1854,8 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
std::swap(StrideAPtr, StrideBPtr);
}
- const SCEV *Dist = PSE.getSE()->getMinusSCEV(Sink, Src);
+ ScalarEvolution &SE = *PSE.getSE();
+ const SCEV *Dist = SE.getMinusSCEV(Sink, Src);
LLVM_DEBUG(dbgs() << "LAA: Src Scev: " << *Src << "Sink Scev: " << *Sink
<< "(Induction step: " << StrideAPtr << ")\n");
@@ -1877,9 +1878,8 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
const SCEVConstant *C = dyn_cast<SCEVConstant>(Dist);
if (!C) {
if (!isa<SCEVCouldNotCompute>(Dist) && HasSameSize &&
- isSafeDependenceDistance(DL, *(PSE.getSE()),
- *(PSE.getBackedgeTakenCount()), *Dist, Stride,
- TypeByteSize))
+ isSafeDependenceDistance(DL, SE, *(PSE.getBackedgeTakenCount()), *Dist,
+ Stride, TypeByteSize))
return Dependence::NoDep;
LLVM_DEBUG(dbgs() << "LAA: Dependence because of non-constant distance\n");