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.
- Almost. Deferred inlining is an exception which can lead to
(empirically) infrequent discrepancies.
In theory we could have a non-thinlto available_externally function, so maybe rename this to something more generic like convertToCopy.