aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2024-11-09 07:05:43 -0800
committerGitHub <noreply@github.com>2024-11-09 07:05:43 -0800
commit3654183afb283c9515a482f07fde730dd458a883 (patch)
tree444a8634b4f4af7b8cbd000266cf8a70b1106da3 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent1d41543c95f884e6ebecc63ab9d0d30ce481345c (diff)
downloadllvm-3654183afb283c9515a482f07fde730dd458a883.zip
llvm-3654183afb283c9515a482f07fde730dd458a883.tar.gz
llvm-3654183afb283c9515a482f07fde730dd458a883.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions