#include "mlir/Transforms/Passes.h"
#include "mlir/Analysis/CallGraph.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Transforms/Inliner.h"
namespace mlir {
#define GEN_PASS_DEF_INLINER
#include "mlir/Transforms/Passes.h.inc"
}
#define DEBUG_TYPE …
usingnamespacemlir;
static void defaultInlinerOptPipeline(OpPassManager &pm) { … }
namespace {
class InlinerPass : public impl::InlinerBase<InlinerPass> { … };
}
InlinerPass::InlinerPass() : … { … }
InlinerPass::InlinerPass(
std::function<void(OpPassManager &)> defaultPipelineArg)
: … { … }
InlinerPass::InlinerPass(std::function<void(OpPassManager &)> defaultPipeline,
llvm::StringMap<OpPassManager> opPipelines)
: … { … }
static bool isProfitableToInline(const Inliner::ResolvedCall &resolvedCall,
unsigned inliningThreshold) { … }
void InlinerPass::runOnOperation() { … }
LogicalResult InlinerPass::initializeOptions(
StringRef options,
function_ref<LogicalResult(const Twine &)> errorHandler) { … }
std::unique_ptr<Pass> mlir::createInlinerPass() { … }
std::unique_ptr<Pass>
mlir::createInlinerPass(llvm::StringMap<OpPassManager> opPipelines) { … }
std::unique_ptr<Pass> mlir::createInlinerPass(
llvm::StringMap<OpPassManager> opPipelines,
std::function<void(OpPassManager &)> defaultPipelineBuilder) { … }