52 lines · plain
1;; Check if basic blocks that don't get unique sections are placed in cold sections.2;; Basic block with id 1 and 2 must be in the cold section.3;;4;; Profile for version 05; RUN: echo '!_Z3bazb' > %t16; RUN: echo '!!0' >> %t17;;8;; Profile for version 19; RUN: echo 'v1' > %t210; RUN: echo 'f _Z3bazb' >> %t211; RUN: echo 'c 0' >> %t212;;13; RUN: llc < %s -mtriple=aarch64 -function-sections -basic-block-sections=%t1 -unique-basic-block-section-names | FileCheck %s -check-prefix=SECTIONS14; RUN: llc < %s -mtriple=aarch64 -function-sections -basic-block-sections=%t2 -unique-basic-block-section-names | FileCheck %s -check-prefix=SECTIONS15; RUN: llc < %s -mtriple=aarch64 -function-sections -basic-block-sections=%t1 -unique-basic-block-section-names -bbsections-cold-text-prefix=".text.unlikely." | FileCheck %s -check-prefix=SPLIT16 17define void @_Z3bazb(i1 zeroext %0) nounwind {18 br i1 %0, label %2, label %419 202: ; preds = %121 %3 = call i32 @_Z3barv()22 br label %623 244: ; preds = %125 %5 = call i32 @_Z3foov()26 br label %627 286: ; preds = %2, %429 ret void30}31 32declare i32 @_Z3barv() #133 34declare i32 @_Z3foov() #135 36; SECTIONS: .section .text.hot._Z3bazb,"ax",@progbits37; SECTIONS: _Z3bazb:38; Check that the basic block with id 1 doesn't get a section.39; SECTIONS-NOT: .section .text{{.*}}._Z3bazb.1,"ax",@progbits,unique40; Check that a single cold section is started here and id 1 and 2 blocks are placed here.41; SECTIONS: .section .text.split._Z3bazb,"ax",@progbits42; SECTIONS: _Z3bazb.cold:43; SECTIONS-NOT: .section .text.hot._Z3bazb._Z3bazb.2,"ax",@progbits,unique44; SECTIONS: .LBB0_2:45; SECTIONS: .size _Z3bazb, .Lfunc_end{{[0-9]}}-_Z3bazb46 47; SPLIT: .section .text.unlikely._Z3bazb,"ax",@progbits48; SPLIT-NEXT: _Z3bazb.cold:49; SPLIT-NEXT: bl _Z3barv50; SPLIT: .LBB0_2:51; SPLIT: .LBB_END0_2:52