aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2023-03-16 19:48:06 +0100
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2023-03-17 09:33:16 +0100
commit951a980dc7aa61b1d414e7d565166ee8071367c6 (patch)
tree3f5fe4e45fab7dddabfe500a716975ec298f74f2 /llvm/lib/Analysis/LoopAccessAnalysis.cpp
parent81d6310da1fc54f0ca0de6fa13246d6071edb0cf (diff)
downloadllvm-951a980dc7aa61b1d414e7d565166ee8071367c6.zip
llvm-951a980dc7aa61b1d414e7d565166ee8071367c6.tar.gz
llvm-951a980dc7aa61b1d414e7d565166ee8071367c6.tar.bz2
[Analysis] Make order of analysis executions more stable
When debugging and using debug-pass-manager (e.g. in regression tests) we prefer a consistent order in which analysis passes are executed. But when for example doing return MyClass(AM.getResult<LoopAnalysis>(F), AM.getResult<DominatorTreeAnalysis>(F)); then the order in which LoopAnalysis and DominatorTreeAnalysis isn't guaranteed, and might for example depend on which compiler that is used when building LLVM. I've not scanned the full source tree, but this fixes some occurances of the above pattern found in lib/Analysis. This problem was discussed briefly in review for D146206.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index aee14ed..d8d61d6 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -2723,11 +2723,13 @@ bool LoopAccessInfoManager::invalidate(
}
LoopAccessInfoManager LoopAccessAnalysis::run(Function &F,
- FunctionAnalysisManager &AM) {
- return LoopAccessInfoManager(
- AM.getResult<ScalarEvolutionAnalysis>(F), AM.getResult<AAManager>(F),
- AM.getResult<DominatorTreeAnalysis>(F), AM.getResult<LoopAnalysis>(F),
- &AM.getResult<TargetLibraryAnalysis>(F));
+ FunctionAnalysisManager &FAM) {
+ auto &SE = FAM.getResult<ScalarEvolutionAnalysis>(F);
+ auto &AA = FAM.getResult<AAManager>(F);
+ auto &DT = FAM.getResult<DominatorTreeAnalysis>(F);
+ auto &LI = FAM.getResult<LoopAnalysis>(F);
+ auto &TLI = FAM.getResult<TargetLibraryAnalysis>(F);
+ return LoopAccessInfoManager(SE, AA, DT, LI, &TLI);
}
char LoopAccessLegacyAnalysis::ID = 0;