47 lines · plain
1; Fine-grained basic block sections, subset of basic blocks in a function.2; Only basic block with id 2 must get a section.3; RUN: echo '!_Z3bazb' > %t4; RUN: echo '!!2' >> %t5; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS6 7define void @_Z3bazb(i1 zeroext) nounwind {8 %2 = alloca i8, align 19 %3 = zext i1 %0 to i810 store i8 %3, ptr %2, align 111 %4 = load i8, ptr %2, align 112 %5 = trunc i8 %4 to i113 br i1 %5, label %6, label %814 156: ; preds = %116 %7 = call i32 @_Z3barv()17 br label %1018 198: ; preds = %120 %9 = call i32 @_Z3foov()21 br label %1022 2310: ; preds = %8, %624 ret void25}26 27declare i32 @_Z3barv() #128 29declare i32 @_Z3foov() #130 31; Check that the correct block is found using the call insts for foo and bar.32;33; LINUX-SECTIONS: .section .text.hot._Z3bazb,"ax",@progbits34; LINUX-SECTIONS: _Z3bazb:35; Check that the basic block with id 1 doesn't get a section.36; LINUX-SECTIONS-NOT: .section .text{{.*}}._Z3bazb.__part.{{[0-9]+}},"ax",@progbits37; LINUX-SECTIONS-LABEL: # %bb.1:38; LINUX-SECTIONS-NEXT: callq _Z3barv39; LINUX-SECTIONS: .section .text.hot._Z3bazb.[[SECTION_LABEL:_Z3bazb.__part.[0-9]+]],"ax",@progbits40; LINUX-SECTIONS-NEXT: [[SECTION_LABEL]]:41; LINUX-SECTIONS-NEXT: callq _Z3foov42; LINUX-SECTIONS: .LBB_END0_2:43; LINUX-SECTIONS-NEXT: .size [[SECTION_LABEL]], .LBB_END0_2-[[SECTION_LABEL]]44; LINUX-SECTIONS: .section .text.hot._Z3bazb,"ax",@progbits45; LINUX-SECTIONS: .Lfunc_end0:46; LINUX-SECTIONS-NEXT: .size _Z3bazb, .Lfunc_end0-_Z3bazb47