Skip to content

Commit

Permalink
Introduce -enable-global-analyses to allow users to disable inter-pro…
Browse files Browse the repository at this point in the history
…cedural 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
  • Loading branch information
nunoplopes committed Sep 19, 2022
1 parent bdb9ca4 commit d953d01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llvm/lib/Passes/PassBuilderPipelines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d953d01

Please sign in to comment.