[llvm] [MemProf] Disable promotion to function declarations by default (PR #192335)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 11:34:34 PDT 2026


aeubanks wrote:

the case I looked at, the symbol wasn't actually dead, it was internalized in another module (maybe those aren't that different?)

there's nothing special about the new metadata, it's just used for deciding whether to inline a function or not in some cases to prevent inlining explosions, removing it wouldn't change any semantics. it's only the fact that it directly references functions that's relevant

I'm trying to understand how ModuleSummaryAnalysis determines if there are ref edges to a function. it looks like it tracks ref edges between functions/global variables, but I don't think there's a way to say "an arbitrary function/global variable in another module might create a reference to a function you have, don't internalize it"? however, the unfortunate thing with this approach and `!inline_history` is that with `!inline_history` we actually are happy to drop declarations, so this can cause regressions in what gets marked as dead.

given we are happy to drop declarations in `!inline_history`, we can special case `!inline_history` in `dropDeadSymbols` and remove declarations in `!inline_history`, allowing us to delete declarations we would have deleted without `!inline_history`, punting the general problem of functions in ValueAsMetadata interactions with ThinLTO

https://github.com/llvm/llvm-project/pull/192335


More information about the llvm-commits mailing list