[llvm] d953d01 - Introduce -enable-global-analyses to allow users to disable inter-procedural analyses
Nuno Lopes via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 19 04:00:52 PDT 2022
Author: Nuno Lopes
Date: 2022-09-19T11:59:35+01:00
New Revision: d953d0173776e7f7109b35ac2e74259dd126ab74
URL: https://github.com/llvm/llvm-project/commit/d953d0173776e7f7109b35ac2e74259dd126ab74
DIFF: https://github.com/llvm/llvm-project/commit/d953d0173776e7f7109b35ac2e74259dd126ab74.diff
LOG: Introduce -enable-global-analyses to allow users to disable inter-procedural analyses
Alive2 doesn't support verification of optimizations that use inter-procedural analyses.
Right now, clang uses GlobalsAA by default and there's no way to disable it.
This leads to Alive2 producing false positives.
The added flag allows us to skip global analyses altogether.
Differential Revision: https://reviews.llvm.org/D134139
Added:
Modified:
llvm/lib/Passes/PassBuilderPipelines.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 9255c011f965e..6d6b0749e9565 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -186,6 +186,10 @@ static cl::opt<bool> EnablePostPGOLoopRotation(
"enable-post-pgo-loop-rotation", cl::init(true), cl::Hidden,
cl::desc("Run the loop rotation transformation after PGO instrumentation"));
+static cl::opt<bool> EnableGlobalAnalyses(
+ "enable-global-analyses", cl::init(true), cl::Hidden,
+ cl::desc("Enable inter-procedural analyses"));
+
PipelineTuningOptions::PipelineTuningOptions() {
LoopInterleaving = true;
LoopVectorization = true;
@@ -1898,7 +1902,8 @@ AAManager PassBuilder::buildDefaultAAPipeline() {
// Because the `AAManager` is a function analysis and `GlobalsAA` is a module
// analysis, all that the `AAManager` can do is query for any *cached*
// results from `GlobalsAA` through a readonly proxy.
- AA.registerModuleAnalysis<GlobalsAA>();
+ if (EnableGlobalAnalyses)
+ AA.registerModuleAnalysis<GlobalsAA>();
// Add target-specific alias analyses.
if (TM)
More information about the llvm-commits
mailing list