32bool FunctionAnalysisManagerModuleProxy::Result::invalidate(
34 ModuleAnalysisManager::Invalidator &Inv) {
54 bool AreFunctionAnalysesPreserved =
59 for (Function &
F : M) {
60 std::optional<PreservedAnalyses> FunctionPA;
65 if (
auto *OuterProxy =
67 for (
const auto &OuterInvalidationPair :
68 OuterProxy->getOuterInvalidations()) {
69 AnalysisKey *OuterAnalysisID = OuterInvalidationPair.first;
70 const auto &InnerAnalysisIDs = OuterInvalidationPair.second;
71 if (Inv.invalidate(OuterAnalysisID, M, PA)) {
74 for (AnalysisKey *InnerAnalysisID : InnerAnalysisIDs)
75 FunctionPA->abandon(InnerAnalysisID);
82 InnerAM->invalidate(
F, *FunctionPA);
88 if (!AreFunctionAnalysesPreserved)
89 InnerAM->invalidate(
F, PA);
100 if (EagerlyInvalidate)
103 Pass->printPipeline(OS, MapClassName2PassName);
114 PassInstrumentation PI = AM.
getResult<PassInstrumentationAnalysis>(
M);
117 for (Function &
F : M) {
118 if (
F.isDeclaration())
127 PreservedAnalyses PassPA = Pass->run(
F,
FAM);
138 PA.intersect(std::move(PassPA));
154 OS <<
"module \"" <<
IR.getName() <<
"\"";
160 OS <<
"function \"" <<
IR.getName() <<
"\"";
#define LLVM_EXPORT_TEMPLATE
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
Legalize the Machine IR a function s Machine IR
FunctionAnalysisManager FAM
Provides implementations for PassManager and AnalysisManager template methods.
This templated class represents "all analyses that operate over <aparticular IR unit>" (e....
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Runs the function pass across every function in the module.
LLVM_ABI void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
A Module instance is used to store all the information related to an LLVM module.
An analysis over an "inner" IR unit that provides access to an analysis manager over a "outer" IR uni...
void runAfterPass(const PassT &Pass, const IRUnitT &IR, const PreservedAnalyses &PA) const
AfterPass instrumentation point - takes Pass instance that has just been executed and constant refere...
bool runBeforePass(const PassT &Pass, const IRUnitT &IR) const
BeforePass instrumentation point - takes Pass instance to be executed and constant reference to IR it...
Manages a sequence of passes over a particular unit of IR.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
bool areAllPreserved() const
Test whether all analyses are preserved (and none are abandoned).
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
bool allAnalysesInSetPreserved() const
Directly test whether a set of analyses is preserved.
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI void printIRUnitNameForStackTrace< Function >(raw_ostream &OS, const Function &IR)
InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy
Provide the FunctionAnalysisManager to Module proxy.
LLVM_ABI void printIRUnitNameForStackTrace< Module >(raw_ostream &OS, const Module &IR)
template class LLVM_TEMPLATE_ABI AllAnalysesOn< Module >
template class LLVM_TEMPLATE_ABI AllAnalysesOn< Function >
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
A special type used to provide an address that identifies a set of related analyses.