[PATCH] D70655: [AutoFDO] Top-down Inlining for specialization with context-sensitive profile

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 10:35:04 PST 2019


wenlei added a comment.

> Can this be handled for cross module (thinLTO) case somehow too?

That'd be nice, but the parallelization and isolation of thin-backends made two things difficult: 1) enforcing global top-down order; 2) adjust profile based on inline decision cross thin-backends, e.g. what D70653 <https://reviews.llvm.org/D70653> was trying to do (current adjustment, scale or merge, only happens on imported clone, which is sometimes not very useful).

What I'm thinking about is to have ThinLink make global inline decision without reading IR (e.g. based on profile and summary) so it's still reasonably thin, and also adjust profile globally based on inline decisions. In addition, ThinLink also need to pass adjusted profile and inline decision to thin-backends for execution. (Not doing the mechanics of inlinine during ThinLink as that can slow it down a lot, but the challenge is without seeing the IR, the inline decision is going to be a proximation, though we may be able to make it very close as the inline heuristics used by sample loader is relatively simple too)

I think conceptually this shouldn't be too disruptive to current implementation, as sample loader is very early in LTO time passes, which is close to ThinLink. But implementation-wise, this is going to be a lot of changes, and a bit intrusive. Chatted with @tejohnson about this during LLVM dev meeting, and I'd love to hear to alternative ideas too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70655/new/

https://reviews.llvm.org/D70655





More information about the llvm-commits mailing list