brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 58cec1b Raw
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=x86_64 -function-sections -basic-block-sections=%t1 -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS14; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=%t2 -unique-basic-block-section-names | FileCheck %s -check-prefix=LINUX-SECTIONS15; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=%t1 -unique-basic-block-section-names -bbsections-cold-text-prefix=".text.unlikely." | FileCheck %s -check-prefix=LINUX-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; LINUX-SECTIONS: .section        .text.hot._Z3bazb,"ax",@progbits37; LINUX-SECTIONS: _Z3bazb:38; Check that the basic block with id 1 doesn't get a section.39; LINUX-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; LINUX-SECTIONS: .section	.text.split._Z3bazb,"ax",@progbits42; LINUX-SECTIONS: _Z3bazb.cold:43; LINUX-SECTIONS-NOT: .section        .text.hot._Z3bazb._Z3bazb.2,"ax",@progbits,unique44; LINUX-SECTIONS: .LBB0_2:45; LINUX-SECTIONS: .size   _Z3bazb, .Lfunc_end{{[0-9]}}-_Z3bazb46 47; LINUX-SPLIT:      .section	.text.unlikely._Z3bazb,"ax",@progbits48; LINUX-SPLIT-NEXT: _Z3bazb.cold:49; LINUX-SPLIT-NEXT:   callq _Z3barv50; LINUX-SPLIT:      .LBB0_2:51; LINUX-SPLIT:      .LBB_END0_2:52