Lines Matching +full:sub +full:- +full:blocks

1 //===-- BasicBlockSections.cpp ---=========--------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // The purpose of this pass is to assign sections to basic blocks when
12 // -fbasic-block-sections= option is used. Further, with profile information
13 // only the subset of basic blocks with profiles are placed in separate sections
14 // and the rest are grouped in a cold section. The exception handling blocks are
20 // With option, -fbasic-block-sections=list, every function may be split into
21 // clusters of basic blocks. Every cluster will be emitted into a separate
22 // section with its basic blocks sequenced in the given order. To get the
28 // of 6 basic blocks 0, 1, ..., 5).
33 // * Basic blocks 0 and 2 are placed in one section with symbol `foo`
35 // * Basic blocks 1, 3, 5 are placed in a separate section. A new symbol
47 // 2. All inter-cluster branch targets would now need to be resolved by the
51 // for inter-cluster branches as the offset is not determined at compile
63 // With -fbasic-block-address-map, we emit the offsets of BB addresses of
66 // the corresponding basic blocks. This logic is implemented in AsmPrinter. This
69 //===----------------------------------------------------------------------===//
88 // via the `-z keep-text-section-prefix` flag.
90 "bbsections-cold-text-prefix",
95 "bbsections-detect-source-drift",
118 /// Identify basic blocks that need separate sections and prepare to emit them
131 BasicBlockSections, "bbsections-prepare",
133 "into clusters of basic blocks.",
136 INITIALIZE_PASS_END(BasicBlockSections, "bbsections-prepare",
138 "into clusters of basic blocks.",
153 // 1- the block ends a section, which means its next block may be
155 // 2- the fallthrough block is not adjacent to the block in the new
158 TII->insertUnconditionalBranch(MBB, FTMBB, MBB.findBranchDebugLoc());
160 // We do not optimize branches for machine basic blocks ending sections, as
169 if (TII->analyzeBranch(MBB, TBB, FBB, Cond))
175 // This function sorts basic blocks according to the cluster's information.
176 // All explicitly specified clusters of basic blocks will be ordered
177 // accordingly. All non-specified BBs go into a separate "Cold" section.
182 // FuncClusterInfo represents the cluster information for basic blocks. It
183 // maps from BBID of basic blocks to their cluster information. If this is
184 // empty, it means unique sections for all basic blocks in the function.
201 // If unique sections are desired for all basic blocks of the function, we
204 // blocks are ordered canonically.
209 MBB.setSectionID(I->second.ClusterID);
212 *MBB.getParent()->getSubtarget().getInstrInfo();
255 // After reordering basic blocks, we must update basic block branches to
269 while (!MI->isEHLabel())
271 MF.getSubtarget().getInstrInfo()->insertNoop(MBB, MI);
284 for (const auto &N : Tuple->operands())
292 // Identify, arrange, and modify basic blocks which need separate sections
293 // according to the specification provided by the -fbasic-block-sections flag.
300 // were obtained, optimizing basic blocks might be sub-optimal.
302 // clusters of basic blocks using basic block ids. Source drift can
303 // invalidate these groupings leading to sub-optimal code generation with
308 // Renumber blocks before sorting them. This is useful for accessing the
350 // We sort all basic blocks to make sure the basic blocks of every cluster are
378 // When the BB address map needs to be generated, this renumbers basic blocks to