[PATCH] D79042: [llvm] Add interface to drive inlining decision using ML model
Mircea Trofin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 13 09:44:28 PDT 2020
mtrofin added inline comments.
================
Comment at: llvm/lib/Analysis/InlineAdvisor.cpp:103-112
+ std::function<AssumptionCache &(Function &)> GetAssumptionCache =
+ [&](Function &F) -> AssumptionCache & {
+ return FAM.getResult<AssumptionAnalysis>(Callee);
+ };
+ auto GetBFI = [&](Function &F) -> BlockFrequencyInfo & {
+ return FAM.getResult<BlockFrequencyAnalysis>(F);
+ };
----------------
dblaikie wrote:
> Any particular reason that GetAssumptionCache is a std::function, but GetBFI/TLI/InlineCost are all lambdas without the std::function wrapper? (probably good to make GetAssumptionCache match the others, I guess)
This is how it was originally, in Inliner.cpp (and still is, it's needed there still). There seems to be a cast issue. I'll investigate separately, as it may involve slightly changing the types of getInlineCost parameters. Left a fixme.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79042/new/
https://reviews.llvm.org/D79042
More information about the llvm-commits
mailing list