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

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 15:39:41 PDT 2023


mtrofin created this revision.
mtrofin added reviewers: kazu, tejohnson, jdoerfert.
Herald added subscribers: hoy, ormris, hiraditya, inglorion.
Herald added a project: All.
mtrofin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

ThinLTO imports (which appear as `available_externally`) that survive
inlining get deleted. With today's inliner that's reasonable, because
the way the function would be inlined into in other modules would be the
same - because of the bottom-up traversal assumption, and the fact that
the inliner doesn't take into account surrounding context [*]. The
ModuleInliner invalidates the first assumption, and the ML inliner the
second.

This patch adds a way to opt-in a module to keep its variant of an
imported function, even if it survived past inlining.

[X] Almost. Deferred inlining is an exception which can lead to

(empirically) infrequent discrepancies.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150148

Files:
  llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
  llvm/test/Transforms/EliminateAvailableExternally/transform-to-local.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150148.520494.patch
Type: text/x-patch
Size: 4472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230508/9e5bae6d/attachment.bin>


More information about the llvm-commits mailing list