13 #ifndef MLIR_TRANSFORMS_INLINER_H
14 #define MLIR_TRANSFORMS_INLINER_H
20 #include "llvm/ADT/StringMap.h"
33 unsigned maxInliningIterations)
34 : defaultPipeline(std::move(defaultPipeline)),
35 maxInliningIterations(maxInliningIterations) {}
38 return defaultPipeline;
43 defaultPipeline = std::move(pipeline);
46 opPipelines = std::move(pipelines);
62 unsigned maxInliningIterations{0};
96 : op(op), cg(cg), pass(pass), am(am),
97 runPipelineHelper(std::move(runPipelineHelper)), config(config),
98 isProfitableToInline(std::move(isProfitableToInline)) {}
static Value max(ImplicitLocOpBuilder &builder, Value value, Value bound)
This class represents an analysis manager for a particular operation instance.
This class represents a single callable in the callgraph.
void setMaxInliningIterations(unsigned max)
const DefaultPipelineTy & getDefaultPipeline() const
const OpPipelinesTy & getOpPipelines() const
void setOpPipelines(OpPipelinesTy pipelines)
std::function< void(OpPassManager &)> DefaultPipelineTy
InlinerConfig(DefaultPipelineTy defaultPipeline, unsigned maxInliningIterations)
void setDefaultPipeline(DefaultPipelineTy pipeline)
unsigned getMaxInliningIterations() const
llvm::StringMap< OpPassManager > OpPipelinesTy
This is an implementation of the inliner that operates bottom up over the Strongly Connected Componen...
void operator=(const Inliner &)=delete
std::function< LogicalResult(Pass &pass, OpPassManager &pipeline, Operation *op)> RunPipelineHelperTy
Inliner(Operation *op, CallGraph &cg, Pass &pass, AnalysisManager am, RunPipelineHelperTy runPipelineHelper, const InlinerConfig &config, ProfitabilityCallbackTy isProfitableToInline)
LogicalResult doInlining()
Perform inlining on a OpTrait::SymbolTable operation.
std::function< bool(const ResolvedCall &)> ProfitabilityCallbackTy
Type of the callback answering if it is profitable to inline a callable operation at a call site.
Inliner(Inliner &)=delete
This class represents a pass manager that runs passes on either a specific operation type,...
Operation is the basic unit of execution within MLIR.
The abstract base pass class.
Include the generated interface declarations.
This struct represents a resolved call to a given callgraph node.
CallGraphNode * sourceNode
ResolvedCall(CallOpInterface call, CallGraphNode *sourceNode, CallGraphNode *targetNode)
CallGraphNode * targetNode