21#ifndef LLVM_CODEGEN_MACHINEPASSMANAGER_H
22#define LLVM_CODEGEN_MACHINEPASSMANAGER_H
36extern template class AnalysisManager<MachineFunction>;
41template <
typename PassT>
63 auto &MFProps =
IR.getProperties();
64 auto RequiredProperties = PassT::getRequiredProperties();
65 if (!MFProps.verifyRequiredProperties(RequiredProperties)) {
66 errs() <<
"MachineFunctionProperties required by " << PassT::name()
67 <<
" pass are not met by function " <<
IR.getName() <<
".\n"
68 <<
"Required properties: ";
69 RequiredProperties.print(
errs());
70 errs() <<
"\nCurrent properties: ";
71 MFProps.print(
errs());
78 auto PA = this->
Pass.run(
IR, AM);
81 IR.getProperties().set(PassT::getSetProperties());
83 IR.getProperties().reset(PassT::getClearedProperties());
89 using has_get_required_properties_t =
90 decltype(std::declval<T &>().getRequiredProperties());
93 using has_get_set_properties_t =
94 decltype(std::declval<T &>().getSetProperties());
97 using has_get_cleared_properties_t =
98 decltype(std::declval<T &>().getClearedProperties());
106bool MachineFunctionAnalysisManagerModuleProxy::Result::invalidate(
197 std::unique_ptr<PassConceptT>
Pass)
208 std::unique_ptr<PassConceptT>
Pass;
211template <
typename MachineFunctionPassT>
212ModuleToMachineFunctionPassAdaptor
219 std::unique_ptr<ModuleToMachineFunctionPassAdaptor::PassConceptT>(
220 new PassModelT(std::forward<MachineFunctionPassT>(
Pass))));
224template <
typename PassT>
229 if constexpr (std::is_same_v<PassT, PassManager<MachineFunction>>) {
230 for (
auto &
P :
Pass.Passes)
231 Passes.push_back(std::move(
P));
233 Passes.push_back(std::unique_ptr<MachinePassModelT>(
234 new MachinePassModelT(std::forward<PassT>(
Pass))));
Legalize the Machine IR a function s Machine IR
Machine Check Debug Module
FunctionAnalysisManager FAM
This header provides internal APIs and implementation details used by the pass management interfaces ...
This header defines various interfaces for pass management in LLVM.
This file defines the SmallVector class.
API to communicate dependencies between analyses during invalidation.
A container for analyses that lazily runs them and caches their results.
void clear(IRUnitT &IR, llvm::StringRef Name)
Clear any cached analysis results for a single unit of IR.
FunctionAnalysisManager & getManager()
Accessor for the analysis manager.
bool invalidate(MachineFunction &IR, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &Inv)
Handler for invalidation of the outer IR unit, IRUnitT.
Result(FunctionAnalysisManager &FAM)
Result & operator=(Result &&RHS)
FunctionAnalysisManagerMachineFunctionProxy(FunctionAnalysisManager &FAM)
Result run(MachineFunction &, MachineFunctionAnalysisManager &)
Run the analysis pass and create our proxy result object.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
ModuleToMachineFunctionPassAdaptor(std::unique_ptr< PassConceptT > Pass)
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Runs the function pass across every function in the module.
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...
Manages a sequence of passes over a particular unit of IR.
LLVM_ATTRIBUTE_MINSIZE void addPass(PassT &&Pass)
PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs)
Run all of the passes in this manager over the given unit of IR.
Pass interface - Implemented by all 'passes'.
A set of analyses that are preserved following a run of a transformation pass.
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.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
typename detail::detector< void, Op, Args... >::value_t is_detected
Detects if a given trait holds for some set of arguments 'Args'.
ModuleToMachineFunctionPassAdaptor createModuleToMachineFunctionPassAdaptor(MachineFunctionPassT &&Pass)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A CRTP mix-in to automatically provide informational APIs needed for passes.
MachinePassModel(PassT &&Pass)
MachinePassModel & operator=(const MachinePassModel &)=delete
PreservedAnalyses run(MachineFunction &IR, MachineFunctionAnalysisManager &AM) override
MachinePassModel & operator=(MachinePassModel RHS)
friend void swap(MachinePassModel &LHS, MachinePassModel &RHS)
Template for the abstract base class used to dispatch polymorphically over pass objects.
A template wrapper used to implement the polymorphic API.