21#ifndef LLVM_CODEGEN_MACHINEPASSMANAGER_H
22#define LLVM_CODEGEN_MACHINEPASSMANAGER_H
36extern template class AnalysisManager<MachineFunction>;
45 auto &MFProps = MF.getProperties();
47 if constexpr (has_get_required_properties_v<PassT>) {
48 auto &MFProps = MF.getProperties();
49 auto RequiredProperties =
P.getRequiredProperties();
50 if (!MFProps.verifyRequiredProperties(RequiredProperties)) {
51 errs() <<
"MachineFunctionProperties required by " << PassT::name()
52 <<
" pass are not met by function " << MF.getName() <<
".\n"
53 <<
"Required properties: ";
54 RequiredProperties.print(
errs());
55 errs() <<
"\nCurrent properties: ";
56 MFProps.print(
errs());
62 if constexpr (has_get_cleared_properties_v<PassT>)
63 MFProps.reset(
P.getClearedProperties());
67 if constexpr (has_get_set_properties_v<PassT>) {
68 auto &MFProps = MF.getProperties();
69 MFProps.set(
P.getSetProperties());
78 using has_get_required_properties_t =
79 decltype(std::declval<T &>().getRequiredProperties());
82 using has_get_set_properties_t =
83 decltype(std::declval<T &>().getSetProperties());
86 using has_get_cleared_properties_t =
87 decltype(std::declval<T &>().getClearedProperties());
90 static constexpr bool has_get_required_properties_v =
94 static constexpr bool has_get_set_properties_v =
98 static constexpr bool has_get_cleared_properties_v =
103template <
typename PassT>
110bool MachineFunctionAnalysisManagerModuleProxy::Result::invalidate(
119bool MachineFunctionAnalysisManagerFunctionProxy::Result::invalidate(
194 :
public PassInfoMixin<FunctionToMachineFunctionPassAdaptor> {
200 std::unique_ptr<PassConceptT>
Pass)
211 std::unique_ptr<PassConceptT>
Pass;
214template <
typename MachineFunctionPassT>
215FunctionToMachineFunctionPassAdaptor
222 std::unique_ptr<FunctionToMachineFunctionPassAdaptor::PassConceptT>(
223 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.
FunctionAnalysisManager & getManager()
Accessor for the analysis manager.
Result(FunctionAnalysisManager &FAM)
Result & operator=(Result &&RHS)
bool invalidate(MachineFunction &IR, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &Inv)
Handler for invalidation of the outer IR unit, IRUnitT.
FunctionAnalysisManagerMachineFunctionProxy(FunctionAnalysisManager &FAM)
Result run(MachineFunction &, MachineFunctionAnalysisManager &)
Run the analysis pass and create our proxy result object.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Runs the function pass across every function in the function.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
FunctionToMachineFunctionPassAdaptor(std::unique_ptr< PassConceptT > Pass)
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
An RAII based helper class to modify MachineFunctionProperties when running pass.
MFPropsModifier(PassT &P_, MachineFunction &MF_)
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
typename detail::detector< void, Op, Args... >::value_t is_detected
Detects if a given trait holds for some set of arguments 'Args'.
PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
FunctionToMachineFunctionPassAdaptor createFunctionToMachineFunctionPassAdaptor(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.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Implement std::hash so that hash_code can be used in STL containers.
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.
Template for the abstract base class used to dispatch polymorphically over pass objects.
A template wrapper used to implement the polymorphic API.