diff options
author | Florian Hahn <flo@fhahn.com> | 2022-10-01 15:44:26 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2022-10-01 15:44:27 +0100 |
commit | 7c0ff64b0f760e364e59a37f983d87835a8c23a1 (patch) | |
tree | 8346613e868b1a078e40753c445790069b12c218 /llvm/lib/Transforms/Utils/LoopVersioning.cpp | |
parent | 781b491bba9d798e53f7784dced3c2be77c81dd4 (diff) | |
download | llvm-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.cpp | 10 |
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)) |