[all-commits] [llvm/llvm-project] d2696d: [llvm] Add -bbsections-cold-text-prefix to emit co...

Snehasish Kumar via All-commits all-commits at lists.llvm.org
Thu Sep 24 15:30:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d2696dec45cdcff791cd53b8b8288d33a0d8dddb
      https://github.com/llvm/llvm-project/commit/d2696dec45cdcff791cd53b8b8288d33a0d8dddb
  Author: Snehasish Kumar <snehasishk at google.com>
  Date:   2020-09-24 (Thu, 24 Sep 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
    M llvm/lib/CodeGen/BasicBlockSections.cpp
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/test/CodeGen/X86/basic-block-sections-cold.ll

  Log Message:
  -----------
  [llvm] Add -bbsections-cold-text-prefix to emit cold clusters to a different section.

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." (D87840), 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).

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




More information about the All-commits mailing list