2 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -verify-machineinstrs -enable-ext-tsp-block-placement -ext-tsp-chain-split-threshold=128 -debug-only=block-placement < %s 2>&1 | FileCheck %s
3 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -verify-machineinstrs -enable-ext-tsp-block-placement -ext-tsp-chain-split-threshold=1 -debug-only=block-placement < %s 2>&1 | FileCheck %s -check-prefix=CHECK2
4 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -verify-machineinstrs -debug-only=block-placement < %s 2>&1 | FileCheck %s -check-prefix=CHECK3
5 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -verify-machineinstrs -enable-ext-tsp-block-placement -ext-tsp-block-placement-max-blocks=8 -debug-only=block-placement < %s 2>&1 | FileCheck %s -check-prefix=CHECK4
7 @yydebug = dso_local global i32 0, align 4
9 define void @func_large() !prof !0 {
10 ; A large CFG instance where chain splitting helps to
11 ; compute a better basic block ordering. The test verifies that with chain
12 ; splitting, the resulting layout is improved (e.g., the score is increased).
15 ; | b0 [76 bytes] | -------------------+
16 ; +----------------+ |
20 ; +----------------+ 766,495,444 +----------------+ |
21 ; | b8 [244 bytes] | <--------------- | b2 [4 bytes] | |
22 ; +----------------+ +----------------+ |
24 ; | | | 2,299,486,333 |
26 ; | | +----------------+ |
27 ; | +----------------------- | b3 [12 bytes] | |
28 ; | +----------------+ |
32 ; | +----------------+ | 574,869,946
33 ; | +-------------- | b4 [12 bytes] | |
34 ; | | +----------------+ |
38 ; | | +----------------+ |
39 ; | | | b5 [116 bytes] | -+ |
40 ; | | +----------------+ | |
44 ; | | +----------------+ | |
45 ; | | +------ | b6 [32 bytes] | | |
46 ; | | | +----------------+ | |
48 ; | | | | 7 | 3,065,981,778 |
50 ; | | | +----------------+ | |
51 ; | | | 1,628 | b9 [16 bytes] | | |
52 ; | | | +----------------+ | |
56 ; | | | +----------------+ | |
57 ; | | +-----> | b7 [12 bytes] | | |
58 ; | | +----------------+ | |
60 ; | | 958,119,305 | 1,636 | |
62 ; | | +------------------------------------------+
63 ; | +-------------> | |
64 ; | 1,532,990,889 | b1 [36 bytes] |
65 ; +-------------------------------> | |
66 ; +------------------------------------------+
68 ; An expected output with a large chain-split-threshold -- the layout score is
71 ; CHECK-LABEL: Applying ext-tsp layout
72 ; CHECK: original layout score: 23587612604815436.00
73 ; CHECK: optimized layout score: 27891096739311172.00
85 ; An expected output with chain-split-threshold=1 (disabling split point enumeration)
87 ; CHECK2-LABEL: Applying ext-tsp layout
88 ; CHECK2: original layout score: 23587612604815436.00
89 ; CHECK2: optimized layout score: 27891096739311172.00
101 ; An expected output with ext-tsp disabled -- the layout is not modified:
103 ; CHECK3-LABEL: func_large:
115 ; An expected output with function size larger than the threshold -- the layout is not modified:
117 ; CHECK4-LABEL: func_large:
130 %0 = load i32, ptr @yydebug, align 4
131 %cmp = icmp ne i32 %0, 0
150 br i1 %cmp, label %b1, label %b2, !prof !1
172 br i1 %cmp, label %b3, label %b8, !prof !2
176 br i1 %cmp, label %b4, label %b8, !prof !3
180 br i1 %cmp, label %b5, label %b1, !prof !4
210 br i1 %cmp, label %b1, label %b6, !prof !5
219 br i1 %cmp, label %b7, label %b9, !prof !6
305 !0 = !{!"function_entry_count", i64 6131963556}
306 !1 = !{!"branch_weights", i32 3065981778, i32 3065981778}
307 !2 = !{!"branch_weights", i32 2299486333, i32 766495444}
308 !3 = !{!"branch_weights", i32 1532990888, i32 766495444}
309 !4 = !{!"branch_weights", i32 574871583, i32 958119305}
310 !5 = !{!"branch_weights", i32 574869946, i32 1636}
311 !6 = !{!"branch_weights", i32 1628, i32 7}