Skip to content

Commit 7d4742f

Browse files
rlavaeeSterling-Augustine
authored andcommitted
Reapply "Deprecate the -fbasic-block-sections=labels option." (llvm#110039)
This reapplies commit 1911a50 with a minor fix in lld/ELF/LTO.cpp which sets Options.BBAddrMap when `--lto-basic-block-sections=labels` is passed.
1 parent 21e6a0a commit 7d4742f

24 files changed

+52
-82
lines changed

clang/docs/UsersManual.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,14 +2369,16 @@ are listed below.
23692369
$ cd $P/bar && clang -c -funique-internal-linkage-names name_conflict.c
23702370
$ cd $P && clang foo/name_conflict.o && bar/name_conflict.o
23712371
2372-
.. option:: -fbasic-block-sections=[labels, all, list=<arg>, none]
2372+
.. option:: -f[no]-basic-block-address-map:
2373+
Emits a ``SHT_LLVM_BB_ADDR_MAP`` section which includes address offsets for each
2374+
basic block in the program, relative to the parent function address.
2375+
2376+
2377+
.. option:: -fbasic-block-sections=[all, list=<arg>, none]
23732378

23742379
Controls how Clang emits text sections for basic blocks. With values ``all``
23752380
and ``list=<arg>``, each basic block or a subset of basic blocks can be placed
2376-
in its own unique section. With the "labels" value, normal text sections are
2377-
emitted, but a ``.bb_addr_map`` section is emitted which includes address
2378-
offsets for each basic block in the program, relative to the parent function
2379-
address.
2381+
in its own unique section.
23802382

23812383
With the ``list=<arg>`` option, a file containing the subset of basic blocks
23822384
that need to placed in unique sections can be specified. The format of the

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,13 @@ class CodeGenOptions : public CodeGenOptionsBase {
107107

108108
// This field stores one of the allowed values for the option
109109
// -fbasic-block-sections=. The allowed values with this option are:
110-
// {"labels", "all", "list=<file>", "none"}.
110+
// {"all", "list=<file>", "none"}.
111111
//
112-
// "labels": Only generate basic block symbols (labels) for all basic
113-
// blocks, do not generate unique sections for basic blocks.
114-
// Use the machine basic block id in the symbol name to
115-
// associate profile info from virtual address to machine
116-
// basic block.
117112
// "all" : Generate basic block sections for all basic blocks.
118113
// "list=<file>": Generate basic block sections for a subset of basic blocks.
119114
// The functions and the machine basic block ids are specified
120115
// in the file.
121-
// "none": Disable sections/labels for basic blocks.
116+
// "none": Disable sections for basic blocks.
122117
std::string BBSections;
123118

124119
// If set, override the default value of MCAsmInfo::BinutilsVersion. If

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4244,8 +4244,8 @@ defm basic_block_address_map : BoolFOption<"basic-block-address-map",
42444244
def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
42454245
Visibility<[ClangOption, CC1Option, CC1AsOption]>,
42464246
HelpText<"Place each function's basic blocks in unique sections (ELF Only)">,
4247-
DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>,
4248-
Values<"all,labels,none,list=">,
4247+
DocBrief<[{Place each basic block or a subset of basic blocks in its own section.}]>,
4248+
Values<"all,none,list=">,
42494249
MarshallingInfoString<CodeGenOpts<"BBSections">, [{"none"}]>;
42504250
defm data_sections : BoolFOption<"data-sections",
42514251
CodeGenOpts<"DataSections">, DefaultFalse,

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ static bool initTargetOptions(DiagnosticsEngine &Diags,
429429
Options.BBSections =
430430
llvm::StringSwitch<llvm::BasicBlockSection>(CodeGenOpts.BBSections)
431431
.Case("all", llvm::BasicBlockSection::All)
432-
.Case("labels", llvm::BasicBlockSection::Labels)
433432
.StartsWith("list=", llvm::BasicBlockSection::List)
434433
.Case("none", llvm::BasicBlockSection::None)
435434
.Default(llvm::BasicBlockSection::None);

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6228,9 +6228,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
62286228

62296229
if (Arg *A = Args.getLastArg(options::OPT_fbasic_block_sections_EQ)) {
62306230
StringRef Val = A->getValue();
6231-
if (Triple.isX86() && Triple.isOSBinFormatELF()) {
6232-
if (Val != "all" && Val != "labels" && Val != "none" &&
6233-
!Val.starts_with("list="))
6231+
if (Val == "labels") {
6232+
D.Diag(diag::warn_drv_deprecated_arg)
6233+
<< A->getAsString(Args) << /*hasReplacement=*/true
6234+
<< "-fbasic-block-address-map";
6235+
CmdArgs.push_back("-fbasic-block-address-map");
6236+
} else if (Triple.isX86() && Triple.isOSBinFormatELF()) {
6237+
if (Val != "all" && Val != "none" && !Val.starts_with("list="))
62346238
D.Diag(diag::err_drv_invalid_value)
62356239
<< A->getAsString(Args) << A->getValue();
62366240
else

clang/test/Driver/fbasic-block-sections.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
// CHECK-OPT-NONE: "-fbasic-block-sections=none"
2323
// CHECK-OPT-ALL: "-fbasic-block-sections=all"
2424
// CHECK-OPT-LIST: "-fbasic-block-sections={{[^ ]*}}fbasic-block-sections.c"
25-
// CHECK-OPT-LABELS: "-fbasic-block-sections=labels"
25+
// CHECK-OPT-LABELS: warning: argument '-fbasic-block-sections=labels' is deprecated, use '-fbasic-block-address-map' instead
26+
// CHECK-OPT-LABELS: "-fbasic-block-address-map"
2627
// CHECK-TRIPLE: error: unsupported option '-fbasic-block-sections=all' for target
2728
// CHECK-INVALID-VALUE: error: invalid value {{[^ ]*}} in '-fbasic-block-sections={{.*}}'
2829
// CHECK-OPT-NULL-LIST: "-fbasic-block-sections=list="

lld/ELF/LTO.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ static lto::Config createConfig(Ctx &ctx) {
6161
c.Options.FunctionSections = true;
6262
c.Options.DataSections = true;
6363

64-
c.Options.BBAddrMap = ctx.arg.ltoBBAddrMap;
65-
6664
// Check if basic block sections must be used.
6765
// Allowed values for --lto-basic-block-sections are "all", "labels",
6866
// "<file name specifying basic block ids>", or none. This is the equivalent
@@ -71,7 +69,8 @@ static lto::Config createConfig(Ctx &ctx) {
7169
if (ctx.arg.ltoBasicBlockSections == "all") {
7270
c.Options.BBSections = BasicBlockSection::All;
7371
} else if (ctx.arg.ltoBasicBlockSections == "labels") {
74-
c.Options.BBSections = BasicBlockSection::Labels;
72+
c.Options.BBAddrMap = true;
73+
c.Options.BBSections = BasicBlockSection::None;
7574
} else if (ctx.arg.ltoBasicBlockSections == "none") {
7675
c.Options.BBSections = BasicBlockSection::None;
7776
} else {
@@ -87,6 +86,8 @@ static lto::Config createConfig(Ctx &ctx) {
8786
}
8887
}
8988

89+
c.Options.BBAddrMap = ctx.arg.ltoBBAddrMap;
90+
9091
c.Options.UniqueBasicBlockSectionNames =
9192
ctx.arg.ltoUniqueBasicBlockSectionNames;
9293

llvm/docs/CommandGuide/llvm-objdump.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ OPTIONS
272272
When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.
273273

274274
When a bb-address-map section is present (i.e., the object file is built with
275-
``-fbasic-block-sections=labels``), labels are retrieved from that section
275+
``-fbasic-block-address-map``), labels are retrieved from that section
276276
instead. If a pgo-analysis-map is present alongside the bb-address-map, any
277277
available analyses are printed after the relevant block label. By default,
278278
any analysis with a special representation (i.e. BlockFrequency,

llvm/docs/Extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ the symbol that belongs to the partition. It may be constructed as follows:
401401
This section stores the binary address of basic blocks along with other related
402402
metadata. This information can be used to map binary profiles (like perf
403403
profiles) directly to machine basic blocks.
404-
This section is emitted with ``-basic-block-sections=labels`` and will contain
404+
This section is emitted with ``-basic-block-address-map`` and will contain
405405
a BB address map table for every function.
406406

407407
The ``SHT_LLVM_BB_ADDR_MAP`` type provides backward compatibility to allow

llvm/include/llvm/CodeGen/MachineFunction.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,6 @@ class LLVM_ABI MachineFunction {
699699
BBSectionsType == BasicBlockSection::Preset);
700700
}
701701

702-
/// Returns true if basic block labels are to be generated for this function.
703-
bool hasBBLabels() const {
704-
return BBSectionsType == BasicBlockSection::Labels;
705-
}
706-
707702
void setBBSectionsType(BasicBlockSection V) { BBSectionsType = V; }
708703

709704
/// Assign IsBeginSection IsEndSection fields for basic blocks in this

llvm/include/llvm/Target/TargetOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ namespace llvm {
6464
List, // Get list of functions & BBs from a file. Selectively enables
6565
// basic block sections for a subset of basic blocks which can be
6666
// used to control object size bloats from creating sections.
67-
Labels, // Do not use Basic Block Sections but label basic blocks. This
68-
// is useful when associating profile counts from virtual addresses
69-
// to basic blocks.
7067
Preset, // Similar to list but the blocks are identified by passes which
7168
// seek to use Basic Block Sections, e.g. MachineFunctionSplitter.
7269
// This option cannot be set via the command line.

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
14321432
OutStreamer->AddComment("BB id");
14331433
// Emit the BB ID for this basic block.
14341434
// We only emit BaseID since CloneID is unset for
1435-
// basic-block-sections=labels.
1435+
// -basic-block-adress-map.
14361436
// TODO: Emit the full BBID when labels and sections can be mixed
14371437
// together.
14381438
OutStreamer->emitULEB128IntValue(MBB.getBBID()->BaseID);
@@ -1866,7 +1866,7 @@ void AsmPrinter::emitFunctionBody() {
18661866
// We must emit temporary symbol for the end of this basic block, if either
18671867
// we have BBLabels enabled or if this basic blocks marks the end of a
18681868
// section.
1869-
if (MF->hasBBLabels() || MF->getTarget().Options.BBAddrMap ||
1869+
if (MF->getTarget().Options.BBAddrMap ||
18701870
(MAI->hasDotTypeDotSizeDirective() && MBB.isEndSection()))
18711871
OutStreamer->emitLabel(MBB.getEndSymbol());
18721872

@@ -2021,7 +2021,7 @@ void AsmPrinter::emitFunctionBody() {
20212021
// Emit section containing BB address offsets and their metadata, when
20222022
// BB labels are requested for this function. Skip empty functions.
20232023
if (HasAnyRealCode) {
2024-
if (MF->hasBBLabels() || MF->getTarget().Options.BBAddrMap)
2024+
if (MF->getTarget().Options.BBAddrMap)
20252025
emitBBAddrMapSection(*MF);
20262026
else if (PgoAnalysisMapFeatures.getBits() != 0)
20272027
MF->getContext().reportWarning(
@@ -2620,7 +2620,7 @@ void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
26202620
F.hasFnAttribute("xray-instruction-threshold") ||
26212621
needFuncLabels(MF, *this) || NeedsLocalForSize ||
26222622
MF.getTarget().Options.EmitStackSizeSection ||
2623-
MF.getTarget().Options.BBAddrMap || MF.hasBBLabels()) {
2623+
MF.getTarget().Options.BBAddrMap) {
26242624
CurrentFnBegin = createTempSymbol("func_begin");
26252625
if (NeedsLocalForSize)
26262626
CurrentFnSymForSize = CurrentFnBegin;
@@ -4155,8 +4155,7 @@ bool AsmPrinter::shouldEmitLabelForBasicBlock(
41554155
// With `-fbasic-block-sections=`, a label is needed for every non-entry block
41564156
// in the labels mode (option `=labels`) and every section beginning in the
41574157
// sections mode (`=all` and `=list=`).
4158-
if ((MF->hasBBLabels() || MF->getTarget().Options.BBAddrMap ||
4159-
MBB.isBeginSection()) &&
4158+
if ((MF->getTarget().Options.BBAddrMap || MBB.isBeginSection()) &&
41604159
!MBB.isEntryBlock())
41614160
return true;
41624161
// A label is needed for any block with at least one predecessor (when that

llvm/lib/CodeGen/BasicBlockSections.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,6 @@ bool BasicBlockSections::handleBBSections(MachineFunction &MF) {
311311
// original layout positions and finding the original fallthroughs.
312312
MF.RenumberBlocks();
313313

314-
if (BBSectionsType == BasicBlockSection::Labels) {
315-
MF.setBBSectionsType(BBSectionsType);
316-
return true;
317-
}
318-
319314
DenseMap<UniqueBBID, BBClusterInfo> FuncClusterInfo;
320315
if (BBSectionsType == BasicBlockSection::List) {
321316
auto [HasProfile, ClusterInfo] =
@@ -382,8 +377,6 @@ bool BasicBlockSections::handleBBSections(MachineFunction &MF) {
382377
// avoids the need to store basic block IDs in the BB address map section, since
383378
// they can be determined implicitly.
384379
bool BasicBlockSections::handleBBAddrMap(MachineFunction &MF) {
385-
if (MF.getTarget().getBBSectionsType() == BasicBlockSection::Labels)
386-
return false;
387380
if (!MF.getTarget().Options.BBAddrMap)
388381
return false;
389382
MF.RenumberBlocks();

llvm/lib/CodeGen/CommandFlags.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,6 @@ llvm::BasicBlockSection
525525
codegen::getBBSectionsMode(llvm::TargetOptions &Options) {
526526
if (getBBSections() == "all")
527527
return BasicBlockSection::All;
528-
else if (getBBSections() == "labels")
529-
return BasicBlockSection::Labels;
530528
else if (getBBSections() == "none")
531529
return BasicBlockSection::None;
532530
else {

llvm/lib/CodeGen/MIRParser/MIParser.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ bool MIParser::parseBasicBlockDefinition(
780780
"' is not defined in the function '" +
781781
MF.getName() + "'");
782782
}
783-
auto *MBB = MF.CreateMachineBasicBlock(BB);
783+
auto *MBB = MF.CreateMachineBasicBlock(BB, BBID);
784784
MF.insert(MF.end(), MBB);
785785
bool WasInserted = MBBSlots.insert(std::make_pair(ID, MBB)).second;
786786
if (!WasInserted)
@@ -799,13 +799,6 @@ bool MIParser::parseBasicBlockDefinition(
799799
MBB->setSectionID(*SectionID);
800800
MF.setBBSectionsType(BasicBlockSection::List);
801801
}
802-
if (BBID.has_value()) {
803-
// BBSectionsType is set to `List` if any basic blocks has `SectionID`.
804-
// Here, we set it to `Labels` if it hasn't been set above.
805-
if (!MF.hasBBSections())
806-
MF.setBBSectionsType(BasicBlockSection::Labels);
807-
MBB->setBBID(BBID.value());
808-
}
809802
MBB->setCallFrameSize(CallFrameSize);
810803
return false;
811804
}

llvm/lib/CodeGen/MIRParser/MIRParser.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,7 @@ MIRParserImpl::initializeMachineFunction(const yaml::MachineFunction &YamlMF,
569569
return true;
570570
}
571571
// Check Basic Block Section Flags.
572-
if (MF.getTarget().getBBSectionsType() == BasicBlockSection::Labels) {
573-
MF.setBBSectionsType(BasicBlockSection::Labels);
574-
} else if (MF.hasBBSections()) {
572+
if (MF.hasBBSections()) {
575573
MF.assignBeginEndSections();
576574
}
577575
PFS.SM = &SM;

llvm/lib/CodeGen/MachineFunction.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,9 @@ MachineFunction::CreateMachineBasicBlock(const BasicBlock *BB,
465465
MachineBasicBlock *MBB =
466466
new (BasicBlockRecycler.Allocate<MachineBasicBlock>(Allocator))
467467
MachineBasicBlock(*this, BB);
468-
// Set BBID for `-basic-block=sections=labels` and
469-
// `-basic-block-sections=list` to allow robust mapping of profiles to basic
470-
// blocks.
471-
if (Target.getBBSectionsType() == BasicBlockSection::Labels ||
472-
Target.Options.BBAddrMap ||
468+
// Set BBID for `-basic-block-sections=list` and `-basic-block-address-map` to
469+
// allow robust mapping of profiles to basic blocks.
470+
if (Target.Options.BBAddrMap ||
473471
Target.getBBSectionsType() == BasicBlockSection::List)
474472
MBB->setBBID(BBID.has_value() ? *BBID : UniqueBBID{NextBBID++, 0});
475473
return MBB;

llvm/test/CodeGen/X86/basic-block-sections-labels-empty-block.ll renamed to llvm/test/CodeGen/X86/basic-block-address-map-empty-block.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;; This test verifies that with -gc-empty-basic-blocks SHT_LLVM_BB_ADDR_MAP will not include entries for empty blocks.
2-
; RUN: llc < %s -mtriple=x86_64 -O0 -basic-block-sections=labels -gc-empty-basic-blocks | FileCheck --check-prefix=CHECK %s
2+
; RUN: llc < %s -mtriple=x86_64 -O0 -basic-block-address-map -gc-empty-basic-blocks | FileCheck --check-prefix=CHECK %s
33

44
define void @foo(i1 zeroext %0) nounwind {
55
br i1 %0, label %2, label %empty_block

llvm/test/CodeGen/X86/basic-block-sections-labels-empty-function.ll renamed to llvm/test/CodeGen/X86/basic-block-address-map-empty-function.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;; Verify that the BB address map is not emitted for empty functions.
2-
; RUN: llc < %s -mtriple=x86_64 -basic-block-sections=labels | FileCheck %s --check-prefixes=CHECK,BASIC
3-
; RUN: llc < %s -mtriple=x86_64 -basic-block-sections=labels -pgo-analysis-map=func-entry-count,bb-freq | FileCheck %s --check-prefixes=CHECK,PGO
2+
; RUN: llc < %s -mtriple=x86_64 -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,BASIC
3+
; RUN: llc < %s -mtriple=x86_64 -basic-block-address-map -pgo-analysis-map=func-entry-count,bb-freq | FileCheck %s --check-prefixes=CHECK,PGO
44

55
define void @empty_func() {
66
entry:

llvm/test/CodeGen/X86/basic-block-address-map-function-sections.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=labels | FileCheck %s
21
; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-address-map | FileCheck %s
32

43
$_Z4fooTIiET_v = comdat any

llvm/test/CodeGen/X86/basic-block-labels-mir-parse.mir renamed to llvm/test/CodeGen/X86/basic-block-address-map-mir-parse.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Start after bbsections0-prepare and check that the BB address map is generated.
2-
# RUN: llc -mtriple x86_64-unknown-linux-gnu -start-after=bbsections-prepare %s -o - | FileCheck %s -check-prefix=CHECK
2+
# RUN: llc -mtriple x86_64-unknown-linux-gnu -start-after=bbsections-prepare -basic-block-address-map %s -o - | FileCheck %s -check-prefix=CHECK
33

44
# How to generate the input:
55
# foo.cc
@@ -9,7 +9,7 @@
99
# }
1010
#
1111
# clang -O0 -S -emit-llvm foo.cc
12-
# llc < foo.ll -stop-after=bbsections-prepare -basic-block-sections=labels
12+
# llc < foo.ll -stop-after=bbsections-prepare -basic-block-address-map
1313

1414
# CHECK: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text
1515
--- |

llvm/test/CodeGen/X86/basic-block-sections-labels-pgo-features.ll renamed to llvm/test/CodeGen/X86/basic-block-address-map-pgo-features.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
; Check the basic block sections labels option
2-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels | FileCheck %s --check-prefixes=CHECK,BASIC
2+
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,BASIC
33

44
;; Also verify this holds for all PGO features enabled
5-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels -pgo-analysis-map=func-entry-count,bb-freq,br-prob | FileCheck %s --check-prefixes=CHECK,PGO-ALL,PGO-FEC,PGO-BBF,PGO-BRP
5+
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-address-map -pgo-analysis-map=func-entry-count,bb-freq,br-prob | FileCheck %s --check-prefixes=CHECK,PGO-ALL,PGO-FEC,PGO-BBF,PGO-BRP
66

77
;; Also verify that pgo extension only includes the enabled feature
8-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels -pgo-analysis-map=func-entry-count | FileCheck %s --check-prefixes=CHECK,PGO-FEC,FEC-ONLY
9-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels -pgo-analysis-map=bb-freq | FileCheck %s --check-prefixes=CHECK,PGO-BBF,BBF-ONLY
10-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels -pgo-analysis-map=br-prob | FileCheck %s --check-prefixes=CHECK,PGO-BRP,BRP-ONLY
8+
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-address-map -pgo-analysis-map=func-entry-count | FileCheck %s --check-prefixes=CHECK,PGO-FEC,FEC-ONLY
9+
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-address-map -pgo-analysis-map=bb-freq | FileCheck %s --check-prefixes=CHECK,PGO-BBF,BBF-ONLY
10+
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-address-map -pgo-analysis-map=br-prob | FileCheck %s --check-prefixes=CHECK,PGO-BRP,BRP-ONLY
1111

1212

1313
define void @_Z3bazb(i1 zeroext, i1 zeroext) personality ptr @__gxx_personality_v0 !prof !0 {

llvm/test/CodeGen/X86/basic-block-address-map.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
; Check the basic block sections labels option
22
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,UNIQ
3-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels | FileCheck %s --check-prefixes=CHECK,UNIQ
43
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=false -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,NOUNIQ
5-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=false -basic-block-sections=labels | FileCheck %s --check-prefixes=CHECK,NOUNIQ
6-
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels -split-machine-functions | FileCheck %s --check-prefixes=CHECK,UNIQ
4+
; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-address-map -split-machine-functions | FileCheck %s --check-prefixes=CHECK,UNIQ
75

86
define void @_Z3bazb(i1 zeroext, i1 zeroext) personality ptr @__gxx_personality_v0 {
97
br i1 %0, label %3, label %8

0 commit comments

Comments
 (0)