@@ -431,10 +431,9 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
431
431
GlobalCleanupPM.addPass (SimplifyCFGPass ());
432
432
MPM.addPass (createModuleToFunctionPassAdaptor (std::move (GlobalCleanupPM)));
433
433
434
- // FIXME: Enable this when cross-IR-unit analysis invalidation is working.
435
- #if 0
436
- MPM.addPass(RequireAnalysisPass<GlobalsAA>());
437
- #endif
434
+ // Require the GlobalsAA analysis for the module so we can query it within
435
+ // the CGSCC pipeline.
436
+ MPM.addPass (RequireAnalysisPass<GlobalsAA, Module>());
438
437
439
438
// Now begin the main postorder CGSCC pipeline.
440
439
// FIXME: The current CGSCC pipeline has its origins in the legacy pass
@@ -482,17 +481,14 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
482
481
// FIXME: Is this really an optimization rather than a canonicalization?
483
482
MPM.addPass (ReversePostOrderFunctionAttrsPass ());
484
483
485
- // Recompute GloblasAA here prior to function passes. This is particularly
484
+ // Re-require GloblasAA here prior to function passes. This is particularly
486
485
// useful as the above will have inlined, DCE'ed, and function-attr
487
486
// propagated everything. We should at this point have a reasonably minimal
488
487
// and richly annotated call graph. By computing aliasing and mod/ref
489
488
// information for all local globals here, the late loop passes and notably
490
489
// the vectorizer will be able to use them to help recognize vectorizable
491
490
// memory operations.
492
- // FIXME: Enable this once analysis invalidation is fully supported.
493
- #if 0
494
- MPM.addPass(Require<GlobalsAA>());
495
- #endif
491
+ MPM.addPass (RequireAnalysisPass<GlobalsAA, Module>());
496
492
497
493
FunctionPassManager OptimizePM (DebugLogging);
498
494
OptimizePM.addPass (Float2IntPass ());
@@ -766,12 +762,8 @@ AAManager PassBuilder::buildDefaultAAPipeline() {
766
762
// Add support for querying global aliasing information when available.
767
763
// Because the `AAManager` is a function analysis and `GlobalsAA` is a module
768
764
// analysis, all that the `AAManager` can do is query for any *cached*
769
- // results from `GlobalsAA` through a readonly proxy..
770
- #if 0
771
- // FIXME: Enable once the invalidation logic supports this. Currently, the
772
- // `AAManager` will hold stale references to the module analyses.
765
+ // results from `GlobalsAA` through a readonly proxy.
773
766
AA.registerModuleAnalysis <GlobalsAA>();
774
- #endif
775
767
776
768
return AA;
777
769
}
0 commit comments