|
2 | 2 | ; REQUIRES: x86-registered-target |
3 | 3 |
|
4 | 4 | ; COM: Machine function splitting with FDO profiles |
5 | | -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s -check-prefixes=MFS-DEFAULTS,MFS-DEFAULTS-X86 |
| 5 | +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s -check-prefixes=MFS-DEFAULTS,MFS-DEFAULTS-X86,MFS-NOBBSECTIONS |
6 | 6 | ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-psi-cutoff=0 -mfs-count-threshold=2000 | FileCheck %s --dump-input=always -check-prefixes=MFS-OPTS1,MFS-OPTS1-X86 |
7 | 7 | ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-psi-cutoff=950000 | FileCheck %s -check-prefixes=MFS-OPTS2,MFS-OPTS2-X86 |
8 | 8 | ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-split-ehcode | FileCheck %s -check-prefixes=MFS-EH-SPLIT,MFS-EH-SPLIT-X86 |
9 | 9 | ; RUN: llc < %s -mtriple=x86_64 -split-machine-functions -O0 -mfs-psi-cutoff=0 -mfs-count-threshold=10000 | FileCheck %s -check-prefixes=MFS-O0,MFS-O0-X86 |
10 | 10 |
|
| 11 | +; COM: Machine function splitting along with -basic-block-sections=list |
| 12 | +; RUN: echo 'v1' > %t |
| 13 | +; RUN: echo 'ffoo21' >> %t |
| 14 | +; RUN: echo 'c0' >> %t |
| 15 | +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -basic-block-sections=%t -split-machine-functions | FileCheck %s --check-prefixes=MFS-DEFAULT,MFS-BBSECTIONS |
| 16 | + |
11 | 17 | ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -aarch64-min-jump-table-entries=4 -enable-split-machine-functions | FileCheck %s -check-prefixes=MFS-DEFAULTS,MFS-DEFAULTS-AARCH64 |
12 | 18 | ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -aarch64-min-jump-table-entries=4 -enable-split-machine-functions -mfs-psi-cutoff=0 -mfs-count-threshold=2000 | FileCheck %s --dump-input=always -check-prefixes=MFS-OPTS1,MFS-OPTS1-AARCH64 |
13 | 19 | ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -aarch64-min-jump-table-entries=4 -enable-split-machine-functions -mfs-psi-cutoff=950000 | FileCheck %s -check-prefixes=MFS-OPTS2,MFS-OPTS2-AARCH64 |
|
20 | 26 | ; RUN: llc < %t.ll -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s --check-prefix=FSAFDO-MFS |
21 | 27 | ; RUN: llc < %t.ll -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s --check-prefix=FSAFDO-MFS2 |
22 | 28 |
|
| 29 | + |
23 | 30 | define void @foo1(i1 zeroext %0) nounwind !prof !14 !section_prefix !15 { |
24 | 31 | ;; Check that cold block is moved to .text.split. |
25 | 32 | ; MFS-DEFAULTS-LABEL: foo1 |
@@ -610,6 +617,34 @@ cold_asm_target: |
610 | 617 | ret void |
611 | 618 | } |
612 | 619 |
|
| 620 | +define void @foo21(i1 zeroext %0) { |
| 621 | +;; Check that a function with basic-block-sections profile is properly split |
| 622 | +;; when the profile is used along with mfs. |
| 623 | +; MFS-BBSECTIONS: .section .text.hot.foo21 |
| 624 | +; MFS-NOBBSECTIONS-NOT: .section .text.hot.foo21 |
| 625 | +; MFS-DEFAULT-DAG: foo21 |
| 626 | +; MFS-NOBBSECTIONS-NOT: foo21.cold |
| 627 | +; MFS-BBSECTIONS: .section .text.split.foo21 |
| 628 | +; MFS-BBSECTIONS-DAG: oo21.cold |
| 629 | + %2 = alloca i8, align 1 |
| 630 | + %3 = zext i1 %0 to i8 |
| 631 | + store i8 %3, ptr %2, align 1 |
| 632 | + %4 = load i8, ptr %2, align 1 |
| 633 | + %5 = trunc i8 %4 to i1 |
| 634 | + br i1 %5, label %6, label %8 |
| 635 | + |
| 636 | +6: ; preds = %1 |
| 637 | + %7 = call i32 @bar() |
| 638 | + br label %10 |
| 639 | + |
| 640 | +8: ; preds = %1 |
| 641 | + %9 = call i32 @baz() |
| 642 | + br label %10 |
| 643 | + |
| 644 | +10: ; preds = %8, %6 |
| 645 | + ret void |
| 646 | +} |
| 647 | + |
613 | 648 | declare i32 @bar() |
614 | 649 | declare i32 @baz() |
615 | 650 | declare i32 @bam() |
|
0 commit comments