[all-commits] [llvm/llvm-project] 365418: [MemProf] Allow promotion if target is a declarati...
Teresa Johnson via All-commits
all-commits at lists.llvm.org
Sat Nov 9 07:06:04 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3654183afb283c9515a482f07fde730dd458a883
https://github.com/llvm/llvm-project/commit/3654183afb283c9515a482f07fde730dd458a883
Author: Teresa Johnson <tejohnson at google.com>
Date: 2024-11-09 (Sat, 09 Nov 2024)
Changed paths:
M llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
M llvm/test/ThinLTO/X86/memprof-icp.ll
Log Message:
-----------
[MemProf] Allow promotion if target is a declaration (#115555)
Fixes an oversight in the MemProf ICP handling, that was blocking
promotion/cloning of indirect calls when the profiled target is a
declaration (i.e wasn't imported). There is no issue promoting in
that case, and in fact the comment mentions we should attempt to at
least import as declarations to enable more promotion.
Note that normal ICP currently requires that the target be a definition,
which is how this check ended up here. The comment there says that it
must be a definition because ThinLTO could remove declarations for
symbols found to be globally dead in the binary. However, here we are
always performing MemProf ICP in the ThinLTO backends, which is after
the globally dead symbols are removed (via dropDeadSymbols before
starting the optimization pipeline) [1].
For now, guard this with an option (flag is off which means the new
promotion is enabled by default) to simplify debugging or disabling it
if
this proves problematic.
[1] In fact we could also be more aggressive in regular ICP when invoked
in the ThinLTO backend
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list