From 4b6eb0e63c698094db5506763df44cc83c19f643 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 20 Mar 2022 12:40:34 +0100 Subject: Merge llvm-project main llvmorg-14-init-10186-gff7f2cfa959b This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-10186-gff7f2cfa959b. PR: 261742 MFC after: 2 weeks (cherry picked from commit 349cc55c9796c4596a5b9904cd3281af295f878f) --- .../llvm/lib/CodeGen/BasicBlockSections.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'contrib/llvm-project/llvm/lib/CodeGen/BasicBlockSections.cpp') diff --git a/contrib/llvm-project/llvm/lib/CodeGen/BasicBlockSections.cpp b/contrib/llvm-project/llvm/lib/CodeGen/BasicBlockSections.cpp index 1a6eed272ca2..c1901bc46d72 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/BasicBlockSections.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/BasicBlockSections.cpp @@ -21,9 +21,21 @@ // clusters of basic blocks. Every cluster will be emitted into a separate // section with its basic blocks sequenced in the given order. To get the // optimized performance, the clusters must form an optimal BB layout for the -// function. Every cluster's section is labeled with a symbol to allow the -// linker to reorder the sections in any arbitrary sequence. A global order of -// these sections would encapsulate the function layout. +// function. We insert a symbol at the beginning of every cluster's section to +// allow the linker to reorder the sections in any arbitrary sequence. A global +// order of these sections would encapsulate the function layout. +// For example, consider the following clusters for a function foo (consisting +// of 6 basic blocks 0, 1, ..., 5). +// +// 0 2 +// 1 3 5 +// +// * Basic blocks 0 and 2 are placed in one section with symbol `foo` +// referencing the beginning of this section. +// * Basic blocks 1, 3, 5 are placed in a separate section. A new symbol +// `foo.__part.1` will reference the beginning of this section. +// * Basic block 4 (note that it is not referenced in the list) is placed in +// one section, and a new symbol `foo.cold` will point to it. // // There are a couple of challenges to be addressed: // -- cgit v1.2.3