[all-commits] [llvm/llvm-project] 77b509: [ICP] Don't promote when target not defined in module

Teresa Johnson via All-commits all-commits at lists.llvm.org
Tue Dec 8 07:46:16 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 77b509710ce7e6aec9ab460bc22a34f44fa94ab3
      https://github.com/llvm/llvm-project/commit/77b509710ce7e6aec9ab460bc22a34f44fa94ab3
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
    M llvm/test/LTO/Resolution/X86/load-sample-prof-icp.ll
    M llvm/test/Transforms/PGOProfile/icp_covariant_call_return.ll
    M llvm/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll
    M llvm/test/Transforms/PGOProfile/indirect_call_promotion_musttail.ll

  Log Message:
  -----------
  [ICP] Don't promote when target not defined in module

This guards against cases where the symbol was dead code eliminated in
the binary by ThinLTO, and we have a sample profile collected for one
binary but used to optimize another.

Most of the benefit from ICP comes from inlining the target, which we
can't do with only a declaration anyway. If this is in the pre-ThinLTO
link step (e.g. for instrumentation based PGO), we will attempt the
promotion again in the ThinLTO backend after importing anyway, and we
don't need the early promotion to facilitate that.

Differential Revision: https://reviews.llvm.org/D92804




More information about the All-commits mailing list