[PATCH] D87813: [llvm][lld] Add an option to emit cold clusters to a different section.

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 21:54:44 PDT 2020


snehasish created this revision.
snehasish added reviewers: tmsriram, MaskRay.
Herald added subscribers: llvm-commits, hiraditya, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
snehasish requested review of this revision.

This change adds an option to basic block sections to allow cold
clusters to be assigned a custom text prefix. With a custom prefix such
as ".text.split.", lld can place them in a separate output section.
The benefits are -

- Empirically shown to improve icache and itlb metrics by 3-5%

(absolute) compared to placing split parts in .text.unlikely.

- Mitigates against poor profiles, eg samplePGO profiles used with the

machine function splitter. Optimizations such as hugepage remapping can
make different decisions at the section granularity.

- Enables section granularity hotness monitoring (checking on the

decisions made during compilation vs sample data from production).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87813

Files:
  lld/ELF/Writer.cpp
  llvm/lib/CodeGen/BasicBlockSections.cpp
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/test/CodeGen/X86/basic-block-sections-cold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87813.292405.patch
Type: text/x-patch
Size: 4668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200917/7dfdbb9e/attachment.bin>


More information about the llvm-commits mailing list