|
3 | 3 |
|
4 | 4 | ; Stop after 'finalize-isel' for simpler MIR, and lower the minimum number of |
5 | 5 | ; jump table entries so 'switch' needs fewer cases to generate a jump table. |
6 | | -; RUN: llc -stop-after=finalize-isel -min-jump-table-entries=2 %s -o %t.mir |
7 | | -; RUN: llc --run-pass=static-data-splitter -stats -x mir %t.mir -o - 2>&1 | FileCheck %s --check-prefix=STAT |
| 6 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -stop-after=finalize-isel -min-jump-table-entries=2 %s -o %t.mir |
| 7 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu --run-pass=static-data-splitter -stats -x mir %t.mir -o - 2>&1 | FileCheck %s --check-prefix=STAT |
| 8 | + |
| 9 | + ; Tests stat messages are expected. |
| 10 | +; STAT-DAG: 2 static-data-splitter - Number of cold jump tables seen |
| 11 | +; STAT-DAG: 2 static-data-splitter - Number of hot jump tables seen |
| 12 | +; STAT-DAG: 1 static-data-splitter - Number of jump tables with unknown hotness |
8 | 13 |
|
9 | 14 | ; When 'partition-static-data-sections' is enabled, static data splitter pass will |
10 | 15 | ; categorize jump tables and assembly printer will place hot jump tables in the |
11 | 16 | ; `.rodata.hot`-prefixed section, and cold ones in the `.rodata.unlikely`-prefixed section. |
12 | 17 | ; Section names will optionally have `.<func>` if -function-sections is enabled. |
13 | | -; RUN: llc -enable-split-machine-functions -partition-static-data-sections=true -function-sections=true -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTHOT |
14 | | -; RUN: llc -enable-split-machine-functions -partition-static-data-sections=true -function-sections=false -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNCLESS,JT |
| 18 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -function-sections=true -min-jump-table-entries=2 -unique-section-names=false %s -o - 2>&1 | FileCheck %s --check-prefixes=LINEAR,JT |
| 19 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -function-sections=true -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTHOT |
| 20 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -function-sections=false -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNCLESS,JT --implicit-check-not=unique |
15 | 21 |
|
16 | | -; RUN: llc -enable-split-machine-functions -partition-static-data-sections=true -min-jump-table-entries=2 -static-data-default-hotness=cold -function-sections=true %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTCOLD |
17 | | - |
18 | | - ; Tests stat messages are expected. |
19 | | -; STAT-DAG: 2 static-data-splitter - Number of cold jump tables seen |
20 | | -; STAT-DAG: 2 static-data-splitter - Number of hot jump tables seen |
21 | | -; STAT-DAG: 1 static-data-splitter - Number of jump tables with unknown hotness |
| 22 | +; Tests that `-static-data-default-hotness` can override hotness for data with |
| 23 | +; unknown hotness. |
| 24 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -min-jump-table-entries=2 -static-data-default-hotness=cold -function-sections=true %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTCOLD |
22 | 25 |
|
23 | | -; Tests that the first and third jump table are placed in a hot-suffixed section, |
24 | | -; and the second and fourth are placed in the original section. |
25 | | -; FUNC: .section .rodata.hot.foo,"a",@progbits |
| 26 | +; LINEAR: .section .rodata.hot,"a",@progbits,unique,2 |
| 27 | +; FUNC: .section .rodata.hot.foo,"a",@progbits |
26 | 28 | ; FUNCLESS: .section .rodata.hot,"a",@progbits |
27 | 29 | ; JT: .LJTI0_0: |
28 | 30 | ; JT: .LJTI0_2: |
29 | | -; FUNC: .section .rodata.unlikely.foo,"a",@progbits |
30 | | -; FUNCLESS: .section .rodata.unlikely,"a",@progbits |
| 31 | +; LINEAR: .section .rodata.unlikely,"a",@progbits,unique,3 |
| 32 | +; FUNC: .section .rodata.unlikely.foo,"a",@progbits |
| 33 | +; FUNCLESS: .section .rodata.unlikely,"a",@progbits |
31 | 34 | ; JT: .LJTI0_1: |
32 | 35 | ; JT: .LJTI0_3: |
33 | 36 | ; DEFAULTHOT: .section .rodata.hot.func_without_entry_count,"a",@progbits |
|
0 commit comments