[PATCH] D21932: [ThinLTO] Perform profile-guided indirect call promotion

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 11:02:34 PDT 2016


tejohnson created this revision.
tejohnson added reviewers: mehdi_amini, xur.
tejohnson added subscribers: llvm-commits, davidxl.
Herald added a subscriber: mehdi_amini.

To enable profile-guided indirect call promotion in ThinLTO mode, we
simply add call graph edges for each profitable target from the profile
to the summaries, then the summary-guided importing will consider the
callee for importing as usual.

Also we need to enable the indirect call promotion pass creation in the
PassManagerBuilder when PerformThinLTO=true (we are in the ThinLTO
backend), so that the newly imported functions are considered for
promotion in the backends.

A couple of other changes:
- Refactored the profitability analysis out of the IC promotion pass and
  into lib/Analysis so that it can be accessed by the summary index
  builder.
- The IC promotion profiles refer to callees by GUID, which required
  adding GUIDs to the per-module VST in bitcode (and assigning them
  valueIds similar to how they are assigned valueIds in the combined
  index).

http://reviews.llvm.org/D21932

Files:
  include/llvm/Analysis/IndirectCallPromotionAnalysis.h
  include/llvm/IR/ModuleSummaryIndex.h
  lib/Analysis/CMakeLists.txt
  lib/Analysis/IndirectCallPromotionAnalysis.cpp
  lib/Analysis/IndirectCallSiteVisitor.h
  lib/Analysis/LLVMBuild.txt
  lib/Analysis/ModuleSummaryAnalysis.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
  test/Transforms/PGOProfile/Inputs/thinlto_indirect_call_promotion.ll
  test/Transforms/PGOProfile/thinlto_indirect_call_promotion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21932.62512.patch
Type: text/x-patch
Size: 30647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160701/a477ec30/attachment-0001.bin>


More information about the llvm-commits mailing list