|
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: echo 'ffoo1' >> %t |
| 16 | +; RUN: echo 'c0 1' >> %t |
| 17 | +; RUN: echo 'c2' >> %t |
| 18 | +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -basic-block-sections=%t -split-machine-functions | FileCheck %s --check-prefixes=MFS-DEFAULT,MFS-BBSECTIONS |
| 19 | + |
11 | 20 | ; 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 | 21 | ; 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 | 22 | ; 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 | 29 | ; RUN: llc < %t.ll -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s --check-prefix=FSAFDO-MFS |
21 | 30 | ; RUN: llc < %t.ll -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s --check-prefix=FSAFDO-MFS2 |
22 | 31 |
|
| 32 | + |
23 | 33 | define void @foo1(i1 zeroext %0) nounwind !prof !14 !section_prefix !15 { |
24 | 34 | ;; Check that cold block is moved to .text.split. |
25 | 35 | ; MFS-DEFAULTS-LABEL: foo1 |
| 36 | +;; Check that we create one extra section with -basic-block-sections. |
| 37 | +; MFS-BBSECTIONS: callq bar |
| 38 | +; MFS-BBSECTIONS: .section .text.hot.foo1 |
| 39 | +; MFS-BBSECTIONS-NEXT: foo1.__part.1: |
| 40 | +; MFS-BBSECTIONS: callq baz |
| 41 | +; MFS_NOBBSECTIONS-NOT: .section .text.hot.foo1 |
26 | 42 | ; MFS-DEFAULTS: .section .text.split.foo1 |
27 | 43 | ; MFS-DEFAULTS-NEXT: foo1.cold: |
28 | 44 | ; MFS-DEFAULTS-X86-NOT: callq bar |
@@ -610,6 +626,34 @@ cold_asm_target: |
610 | 626 | ret void |
611 | 627 | } |
612 | 628 |
|
| 629 | +define void @foo21(i1 zeroext %0) { |
| 630 | +;; Check that a function with basic-block-sections profile is properly split |
| 631 | +;; when the profile is used along with mfs. |
| 632 | +; MFS-BBSECTIONS: .section .text.hot.foo21 |
| 633 | +; MFS-NOBBSECTIONS-NOT: .section .text.hot.foo21 |
| 634 | +; MFS-DEFAULT-DAG: foo21 |
| 635 | +; MFS-NOBBSECTIONS-NOT: foo21.cold |
| 636 | +; MFS-BBSECTIONS: .section .text.split.foo21 |
| 637 | +; MFS-BBSECTIONS-DAG: oo21.cold |
| 638 | + %2 = alloca i8, align 1 |
| 639 | + %3 = zext i1 %0 to i8 |
| 640 | + store i8 %3, ptr %2, align 1 |
| 641 | + %4 = load i8, ptr %2, align 1 |
| 642 | + %5 = trunc i8 %4 to i1 |
| 643 | + br i1 %5, label %6, label %8 |
| 644 | + |
| 645 | +6: ; preds = %1 |
| 646 | + %7 = call i32 @bar() |
| 647 | + br label %10 |
| 648 | + |
| 649 | +8: ; preds = %1 |
| 650 | + %9 = call i32 @baz() |
| 651 | + br label %10 |
| 652 | + |
| 653 | +10: ; preds = %8, %6 |
| 654 | + ret void |
| 655 | +} |
| 656 | + |
613 | 657 | declare i32 @bar() |
614 | 658 | declare i32 @baz() |
615 | 659 | declare i32 @bam() |
|
0 commit comments