diff --git a/llvm/lib/CodeGen/BasicBlockSections.cpp b/llvm/lib/CodeGen/BasicBlockSections.cpp --- a/llvm/lib/CodeGen/BasicBlockSections.cpp +++ b/llvm/lib/CodeGen/BasicBlockSections.cpp @@ -81,12 +81,12 @@ // Placing the cold clusters in a separate section mitigates against poor // profiles and allows optimizations such as hugepage mapping to be applied at a -// section granularity. Where necessary, users should set this to ".text.split." -// which is recognized by lld via the `-z keep-text-section-prefix` flag. +// section granularity. Defaults to ".text.split." which is recognized by lld +// via the `-z keep-text-section-prefix` flag. cl::opt llvm::BBSectionsColdTextPrefix( "bbsections-cold-text-prefix", cl::desc("The text prefix to use for cold basic block clusters"), - cl::init(".text.unlikely."), cl::Hidden); + cl::init(".text.split."), cl::Hidden); namespace { diff --git a/llvm/test/CodeGen/X86/basic-block-sections-clusters-branches.ll b/llvm/test/CodeGen/X86/basic-block-sections-clusters-branches.ll --- a/llvm/test/CodeGen/X86/basic-block-sections-clusters-branches.ll +++ b/llvm/test/CodeGen/X86/basic-block-sections-clusters-branches.ll @@ -50,7 +50,7 @@ ; LINUX-SECTIONS1: .section .text.foo,"ax",@progbits,unique,1 ; LINUX-SECTIONS1-LABEL: foo.1: ; LINUX-SECTIONS1: jmp foo.cold -; LINUX-SECTIONS1: .section .text.unlikely.foo,"ax",@progbits +; LINUX-SECTIONS1: .section .text.split.foo,"ax",@progbits ; LINUX-SECTIONS1-LABEL: foo.cold: ; LINUX-SECTIONS2: .section .text.foo,"ax",@progbits diff --git a/llvm/test/CodeGen/X86/basic-block-sections-clusters.ll b/llvm/test/CodeGen/X86/basic-block-sections-clusters.ll --- a/llvm/test/CodeGen/X86/basic-block-sections-clusters.ll +++ b/llvm/test/CodeGen/X86/basic-block-sections-clusters.ll @@ -50,7 +50,7 @@ ; LINUX-SECTIONS1-LABEL: .LBB_END0_1: ; LINUX-SECTIONS1-NEXT: .size foo.1, .LBB_END0_1-foo.1 ; LINUX-SECTIONS1-NOT: .section -; LINUX-SECTIONS1: .section .text.unlikely.foo,"ax",@progbits +; LINUX-SECTIONS1: .section .text.split.foo,"ax",@progbits ; LINUX-SECTIONS1-LABEL: foo.cold: ; LINUX-SECTIONS1-LABEL: .LBB_END0_3: ; LINUX-SECTIONS1-NEXT: .size foo.cold, .LBB_END0_3-foo.cold diff --git a/llvm/test/CodeGen/X86/basic-block-sections-cold.ll b/llvm/test/CodeGen/X86/basic-block-sections-cold.ll --- a/llvm/test/CodeGen/X86/basic-block-sections-cold.ll +++ b/llvm/test/CodeGen/X86/basic-block-sections-cold.ll @@ -3,7 +3,7 @@ ; RUN: echo '!_Z3bazb' > %t ; RUN: echo '!!0' >> %t ; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=%t -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS -; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=%t -unique-basic-block-section-names -bbsections-cold-text-prefix=".text.split." | FileCheck %s -check-prefix=LINUX-SPLIT +; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=%t -unique-basic-block-section-names -bbsections-cold-text-prefix=".text.unlikely." | FileCheck %s -check-prefix=LINUX-SPLIT define void @_Z3bazb(i1 zeroext %0) nounwind { br i1 %0, label %2, label %4 @@ -29,13 +29,13 @@ ; Check that the basic block with id 1 doesn't get a section. ; LINUX-SECTIONS-NOT: .section .text._Z3bazb._Z3bazb.1,"ax",@progbits,unique ; Check that a single cold section is started here and id 1 and 2 blocks are placed here. -; LINUX-SECTIONS: .section .text.unlikely._Z3bazb,"ax",@progbits +; LINUX-SECTIONS: .section .text.split._Z3bazb,"ax",@progbits ; LINUX-SECTIONS: _Z3bazb.cold: ; LINUX-SECTIONS-NOT: .section .text._Z3bazb._Z3bazb.2,"ax",@progbits,unique ; LINUX-SECTIONS: .LBB0_2: ; LINUX-SECTIONS: .size _Z3bazb, .Lfunc_end{{[0-9]}}-_Z3bazb -; LINUX-SPLIT: .section .text.split._Z3bazb,"ax",@progbits +; LINUX-SPLIT: .section .text.unlikely._Z3bazb,"ax",@progbits ; LINUX-SPLIT-NEXT: _Z3bazb.cold: ; LINUX-SPLIT-NEXT: callq _Z3barv ; LINUX-SPLIT: .LBB0_2: