[PATCH] D150148: [IPO] Opt-in local clones for thinlto imports

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 12:35:32 PDT 2023


mtrofin added a comment.

In D150148#4335709 <https://reviews.llvm.org/D150148#4335709>, @tejohnson wrote:

> Can we do this during the importing process? E.g. somewhere in FunctionImportGlobalProcessing::processGlobalForThinLTO.

(capturing discussion offline) I actually had it that way originally, but there are 2 main complications with it. The most important one is about ICP. If we did this before any ICP for a function `F`, we'd have to remember the association between `F` and `F.__uniq.123` (the latter is the local copy), so that the ICP test would be in terms of `F`, not `F.__uniq.123`. With how the pass is currently positioned, that's not an issue, because ICP happened, and the non-`CallBase` use of `F` (the value test, in this case) isn't modified. A good way to keep that association (and make it explicit and intentional) is via metadata, but it'd complicate the implementation.

The second (and related) problem is that we'd also need to update the value profile to reference the new GUID instead of the old one (as GUIDs are computed using both name and linkage), which the current implementation doesn't need to do (and I need to add a comment about that.)

We can revisit this later, of course.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150148



More information about the llvm-commits mailing list