aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopVersioning.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2022-10-01 15:44:26 +0100
committerFlorian Hahn <flo@fhahn.com>2022-10-01 15:44:27 +0100
commit7c0ff64b0f760e364e59a37f983d87835a8c23a1 (patch)
tree8346613e868b1a078e40753c445790069b12c218 /llvm/lib/Transforms/Utils/LoopVersioning.cpp
parent781b491bba9d798e53f7784dced3c2be77c81dd4 (diff)
downloadllvm-7c0ff64b0f760e364e59a37f983d87835a8c23a1.zip
llvm-7c0ff64b0f760e364e59a37f983d87835a8c23a1.tar.gz
llvm-7c0ff64b0f760e364e59a37f983d87835a8c23a1.tar.bz2
[LAA] Change to function analysis for new PM.
At the moment, LoopAccessAnalysis is a loop analysis for the new pass manager. The issue with that is that LAI caches SCEV expressions and modifications in a loop may impact SCEV expressions in other loops, but we do not have a convenient way to invalidate LAI for other loops withing a loop pipeline. To avoid this issue, turn it into a function analysis which returns a manager object that keeps track of the individual LAI objects per loop. Fixes #50940. Fixes #51669. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D134606
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopVersioning.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopVersioning.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 6309eed..c798f0a 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -348,17 +348,11 @@ PreservedAnalyses LoopVersioningPass::run(Function &F,
FunctionAnalysisManager &AM) {
auto &SE = AM.getResult<ScalarEvolutionAnalysis>(F);
auto &LI = AM.getResult<LoopAnalysis>(F);
- auto &TTI = AM.getResult<TargetIRAnalysis>(F);
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
- auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
- auto &AA = AM.getResult<AAManager>(F);
- auto &AC = AM.getResult<AssumptionAnalysis>(F);
- auto &LAM = AM.getResult<LoopAnalysisManagerFunctionProxy>(F).getManager();
+ LoopAccessInfoManager &LAIs = AM.getResult<LoopAccessAnalysis>(F);
auto GetLAA = [&](Loop &L) -> const LoopAccessInfo & {
- LoopStandardAnalysisResults AR = {AA, AC, DT, LI, SE,
- TLI, TTI, nullptr, nullptr, nullptr};
- return LAM.getResult<LoopAccessAnalysis>(L, AR);
+ return LAIs.getInfo(L);
};
if (runImpl(&LI, GetLAA, &DT, &SE))