1 # Test the control of aggressiveness of 3-way splitting by -call-scale.
2 # When -call-scale=0.0, the tested function is 2-way splitted.
3 # When -call-scale=1.0, the tested function is 3-way splitted with 5 blocks
4 # in warm because of the increased benefit of shortening the call edges.
5 # When -call-scale=1000.0, the tested function is still 3-way splitted with
6 # 5 blocks in warm because cdsplit does not allow hot-warm splitting to break
7 # a fall through branch from a basic block to its most likely successor.
9 # RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
10 # RUN: link_fdata %s %t.o %t.fdata
11 # RUN: llvm-strip --strip-unneeded %t.o
12 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
13 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=cdsplit \
14 # RUN: --call-scale=0.0 --print-split --print-only=chain \
15 # RUN: --data=%t.fdata --reorder-blocks=ext-tsp \
16 # RUN: 2>&1 | FileCheck --check-prefix=LOWINCENTIVE %s
17 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=cdsplit \
18 # RUN: --call-scale=1.0 --print-split --print-only=chain \
19 # RUN: --data=%t.fdata --reorder-blocks=ext-tsp \
20 # RUN: 2>&1 | FileCheck --check-prefix=MEDINCENTIVE %s
21 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=cdsplit \
22 # RUN: --call-scale=1000.0 --print-split --print-only=chain \
23 # RUN: --data=%t.fdata --reorder-blocks=ext-tsp \
24 # RUN: 2>&1 | FileCheck --check-prefix=HIGHINCENTIVE %s
26 # LOWINCENTIVE: Binary Function "chain" after split-functions
27 # LOWINCENTIVE: {{^\.Ltmp5}}
28 # LOWINCENTIVE: ------- HOT-COLD SPLIT POINT -------
29 # LOWINCENTIVE: {{^\.LFT1}}
31 # MEDINCENTIVE: Binary Function "chain" after split-functions
32 # MEDINCENTIVE: {{^\.Ltmp1}}
33 # MEDINCENTIVE: ------- HOT-COLD SPLIT POINT -------
34 # MEDINCENTIVE: {{^\.LFT1}}
35 # MEDINCENTIVE: ------- HOT-COLD SPLIT POINT -------
36 # MEDINCENTIVE: {{^\.Ltmp0}}
37 # MEDINCENTIVE: {{^\.Ltmp2}}
38 # MEDINCENTIVE: {{^\.Ltmp3}}
39 # MEDINCENTIVE: {{^\.Ltmp4}}
40 # MEDINCENTIVE: {{^\.Ltmp5}}
42 # HIGHINCENTIVE: Binary Function "chain" after split-functions
43 # HIGHINCENTIVE: {{^\.Ltmp1}}
44 # HIGHINCENTIVE: ------- HOT-COLD SPLIT POINT -------
45 # HIGHINCENTIVE: {{^\.LFT1}}
46 # HIGHINCENTIVE: ------- HOT-COLD SPLIT POINT -------
47 # HIGHINCENTIVE: {{^\.Ltmp0}}
48 # HIGHINCENTIVE: {{^\.Ltmp2}}
49 # HIGHINCENTIVE: {{^\.Ltmp3}}
50 # HIGHINCENTIVE: {{^\.Ltmp4}}
51 # HIGHINCENTIVE: {{^\.Ltmp5}}
57 .type chain, @function
62 LLentry_LLchain_start
:
64 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLchain_start# 0 10
65 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLfast# 0 500
70 # FDATA: 1 chain #LLfast_LLexit# 1 chain #LLexit# 0 500
73 LLchain_start_LLchain1
:
75 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLchain1# 0 10
76 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLcold# 0 0
88 # FDATA: 1 chain #LLchain1_LLchain2# 1 chain #LLchain2# 0 10
93 # FDATA: 1 chain #LLchain2_LLchain3# 1 chain #LLchain3# 0 10
102 # FDATA: 1 chain #LLchain3_LLchain4# 1 chain #LLchain4# 0 10
111 # FDATA: 1 chain #LLchain4_LLexit# 1 chain #LLexit# 0 10
116 .size chain, LLchain_end-chain
120 .type main, @function
127 # FDATA: 1 main #LLmain_chain1# 1 chain 0 0 500
131 # FDATA: 1 main #LLmain_chain2# 1 chain 0 0 10
136 .size main, .Lmain_end-main