23#ifndef LLVM_CODEGEN_MACHINEPASSMANAGER_H
24#define LLVM_CODEGEN_MACHINEPASSMANAGER_H
38extern template class AnalysisManager<MachineFunction>;
45template <
typename DerivedT>
84 Pass.printPipeline(
OS, MapClassName2PassName);
92 static std::enable_if_t<is_detected<has_required_t, T>::value,
bool>
94 return T::isRequired();
97 static std::enable_if_t<!is_detected<has_required_t, T>::value,
bool>
101 bool isRequired()
const override {
return passIsRequiredImpl<PassT>(); }
103 template <
typename T>
105 decltype(std::declval<T &>().getRequiredProperties());
106 template <
typename T>
107 static std::enable_if_t<is_detected<has_get_required_properties_t, T>::value,
110 return PassT::getRequiredProperties();
112 template <
typename T>
113 static std::enable_if_t<!is_detected<has_get_required_properties_t, T>::value,
119 return getRequiredPropertiesImpl<PassT>();
122 template <
typename T>
124 decltype(std::declval<T &>().getSetProperties());
125 template <
typename T>
126 static std::enable_if_t<is_detected<has_get_set_properties_t, T>::value,
129 return PassT::getSetProperties();
131 template <
typename T>
132 static std::enable_if_t<!is_detected<has_get_set_properties_t, T>::value,
138 return getSetPropertiesImpl<PassT>();
141 template <
typename T>
143 decltype(std::declval<T &>().getClearedProperties());
144 template <
typename T>
145 static std::enable_if_t<is_detected<has_get_cleared_properties_t, T>::value,
148 return PassT::getClearedProperties();
150 template <
typename T>
151 static std::enable_if_t<!is_detected<has_get_cleared_properties_t, T>::value,
157 return getClearedPropertiesImpl<PassT>();
168bool MachineFunctionAnalysisManagerModuleProxy::Result::invalidate(
258 std::unique_ptr<MachinePassConcept>
Pass)
269 std::unique_ptr<MachinePassConcept>
Pass;
272template <
typename MachineFunctionPassT>
273ModuleToMachineFunctionPassAdaptor
279 std::unique_ptr<detail::MachinePassConcept>(
280 new PassModelT(std::forward<MachineFunctionPassT>(
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...
Properties which a MachineFunction may have at a given point in time.
ModuleToMachineFunctionPassAdaptor(std::unique_ptr< MachinePassConcept > 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.
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.
ModuleToMachineFunctionPassAdaptor createModuleToMachineFunctionPassAdaptor(MachineFunctionPassT &&Pass)
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 that provides informational APIs needed for machine passes.
A CRTP mix-in to automatically provide informational APIs needed for passes.
virtual MachineFunctionProperties getClearedProperties() const =0
virtual MachineFunctionProperties getRequiredProperties() const =0
virtual MachineFunctionProperties getSetProperties() const =0
static std::enable_if_t<!is_detected< has_get_required_properties_t, T >::value, MachineFunctionProperties > getRequiredPropertiesImpl()
MachineFunctionProperties getSetProperties() const override
StringRef name() const override
Polymorphic method to access the name of a pass.
static std::enable_if_t< is_detected< has_required_t, T >::value, bool > passIsRequiredImpl()
MachineFunctionProperties getRequiredProperties() const override
MachinePassModel(MachinePassModel &&Arg)
decltype(std::declval< T & >().isRequired()) has_required_t
MachinePassModel(PassT &&Pass)
MachinePassModel & operator=(const MachinePassModel &)=delete
static std::enable_if_t< is_detected< has_get_cleared_properties_t, T >::value, MachineFunctionProperties > getClearedPropertiesImpl()
PreservedAnalyses run(MachineFunction &IR, MachineFunctionAnalysisManager &AM) override
MachineFunctionProperties getClearedProperties() const override
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) override
decltype(std::declval< T & >().getSetProperties()) has_get_set_properties_t
MachinePassModel & operator=(MachinePassModel RHS)
static std::enable_if_t<!is_detected< has_get_set_properties_t, T >::value, MachineFunctionProperties > getSetPropertiesImpl()
static std::enable_if_t< is_detected< has_get_required_properties_t, T >::value, MachineFunctionProperties > getRequiredPropertiesImpl()
bool isRequired() const override
Polymorphic method to let a pass optionally exempted from skipping by PassInstrumentation.
static std::enable_if_t< is_detected< has_get_set_properties_t, T >::value, MachineFunctionProperties > getSetPropertiesImpl()
MachinePassModel(const MachinePassModel &Arg)
static std::enable_if_t<!is_detected< has_get_cleared_properties_t, T >::value, MachineFunctionProperties > getClearedPropertiesImpl()
decltype(std::declval< T & >().getRequiredProperties()) has_get_required_properties_t
friend void swap(MachinePassModel &LHS, MachinePassModel &RHS)
decltype(std::declval< T & >().getClearedProperties()) has_get_cleared_properties_t
static std::enable_if_t<!is_detected< has_required_t, T >::value, bool > passIsRequiredImpl()
Template for the abstract base class used to dispatch polymorphically over pass objects.