25 std::string IRName =
"";
27 Ctx = &
M->getContext();
30 Ctx = &
F->getContext();
31 IRName =
F->getName().str();
52bool FunctionAnalysisManagerModuleProxy::Result::invalidate(
54 ModuleAnalysisManager::Invalidator &Inv) {
74 bool AreFunctionAnalysesPreserved =
80 std::optional<PreservedAnalyses> FunctionPA;
85 if (
auto *OuterProxy =
87 for (
const auto &OuterInvalidationPair :
88 OuterProxy->getOuterInvalidations()) {
89 AnalysisKey *OuterAnalysisID = OuterInvalidationPair.first;
90 const auto &InnerAnalysisIDs = OuterInvalidationPair.second;
91 if (Inv.invalidate(OuterAnalysisID, M, PA)) {
94 for (AnalysisKey *InnerAnalysisID : InnerAnalysisIDs)
95 FunctionPA->abandon(InnerAnalysisID);
102 InnerAM->invalidate(
F, *FunctionPA);
108 if (!AreFunctionAnalysesPreserved)
109 InnerAM->invalidate(
F, PA);
120 if (EagerlyInvalidate)
123 Pass->printPipeline(OS, MapClassName2PassName);
134 PassInstrumentation PI = AM.
getResult<PassInstrumentationAnalysis>(
M);
138 if (
F.isDeclaration())
147 PreservedAnalyses PassPA = Pass->run(
F,
FAM);
158 PA.intersect(std::move(PassPA));
174 OS <<
"module \"" <<
IR.getName() <<
"\"";
180 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
This file declares the interface for bisecting optimizations.
FunctionAnalysisManager FAM
Provides implementations for PassManager and AnalysisManager template methods.
static const char PassName[]
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.
A type-erased reference to the IR unit a pass or analysis is running on, together with the kind of IR...
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
This is an important class for using LLVM in a threaded context.
LLVM_ABI OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
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.
virtual bool shouldRunPass(StringRef PassName, StringRef IRDescription) const
IRDescription is a textual description of the IR unit the pass is running over.
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.
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.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI bool shouldSkipOptimizationForOptBisect(IRUnitRef IR, StringRef PassName)
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
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.