diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/Transforms/IPO/ModuleInliner.cpp | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'llvm/lib/Transforms/IPO/ModuleInliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/ModuleInliner.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/ModuleInliner.cpp b/llvm/lib/Transforms/IPO/ModuleInliner.cpp index ee382657f5e6..5e91ab80d750 100644 --- a/llvm/lib/Transforms/IPO/ModuleInliner.cpp +++ b/llvm/lib/Transforms/IPO/ModuleInliner.cpp @@ -138,17 +138,12 @@ PreservedAnalyses ModuleInlinerPass::run(Module &M, // // TODO: Here is a huge amount duplicate code between the module inliner and // the SCC inliner, which need some refactoring. - auto Calls = getInlineOrder(FAM, Params); + auto Calls = getInlineOrder(FAM, Params, MAM, M); assert(Calls != nullptr && "Expected an initialized InlineOrder"); // Populate the initial list of calls in this module. for (Function &F : M) { auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F); - // We want to generally process call sites top-down in order for - // simplifications stemming from replacing the call with the returned value - // after inlining to be visible to subsequent inlining decisions. - // FIXME: Using instructions sequence is a really bad way to do this. - // Instead we should do an actual RPO walk of the function body. for (Instruction &I : instructions(F)) if (auto *CB = dyn_cast<CallBase>(&I)) if (Function *Callee = CB->getCalledFunction()) { @@ -213,7 +208,7 @@ PreservedAnalyses ModuleInlinerPass::run(Module &M, // Setup the data structure used to plumb customization into the // `InlineFunction` routine. InlineFunctionInfo IFI( - /*cg=*/nullptr, GetAssumptionCache, PSI, + GetAssumptionCache, PSI, &FAM.getResult<BlockFrequencyAnalysis>(*(CB->getCaller())), &FAM.getResult<BlockFrequencyAnalysis>(Callee)); |