[llvm] c035efc - [LAA] Cache PSE.getSE() in variable (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 25 13:43:02 PDT 2022
Author: Florian Hahn
Date: 2022-08-25T21:40:22+01:00
New Revision: c035efc814e6eba4fe3030260fdab64f56d7f1d0
URL: https://github.com/llvm/llvm-project/commit/c035efc814e6eba4fe3030260fdab64f56d7f1d0
DIFF: https://github.com/llvm/llvm-project/commit/c035efc814e6eba4fe3030260fdab64f56d7f1d0.diff
LOG: [LAA] Cache PSE.getSE() in variable (NFC).
Preparation for follow-up patches will introduce additional uses
of SE.
Added:
Modified:
llvm/lib/Analysis/LoopAccessAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index a9a4a820db50a..a95b43279318f 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");
More information about the llvm-commits
mailing list