2 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -enable-ext-tsp-block-placement=1 -ext-tsp-chain-split-threshold=128 -debug-only=block-placement < %s 2>&1 | FileCheck %s
3 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -enable-ext-tsp-block-placement=1 -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 -enable-ext-tsp-block-placement=0 -debug-only=block-placement < %s 2>&1 | FileCheck %s -check-prefix=CHECK3
6 @yydebug = dso_local global i32 0, align 4
8 define void @func_large() !prof !0 {
9 ; A large CFG instance where chain splitting helps to
10 ; compute a better basic block ordering. The test verifies that with chain
11 ; splitting, the resulting layout is improved (e.g., the score is increased).
14 ; | b0 [76 bytes] | -------------------+
15 ; +----------------+ |
19 ; +----------------+ 766,495,444 +----------------+ |
20 ; | b8 [244 bytes] | <--------------- | b2 [4 bytes] | |
21 ; +----------------+ +----------------+ |
23 ; | | | 2,299,486,333 |
25 ; | | +----------------+ |
26 ; | +----------------------- | b3 [12 bytes] | |
27 ; | +----------------+ |
31 ; | +----------------+ | 574,869,946
32 ; | +-------------- | b4 [12 bytes] | |
33 ; | | +----------------+ |
37 ; | | +----------------+ |
38 ; | | | b5 [116 bytes] | -+ |
39 ; | | +----------------+ | |
43 ; | | +----------------+ | |
44 ; | | +------ | b6 [32 bytes] | | |
45 ; | | | +----------------+ | |
47 ; | | | | 7 | 3,065,981,778 |
49 ; | | | +----------------+ | |
50 ; | | | 1,628 | b9 [16 bytes] | | |
51 ; | | | +----------------+ | |
55 ; | | | +----------------+ | |
56 ; | | +-----> | b7 [12 bytes] | | |
57 ; | | +----------------+ | |
59 ; | | 958,119,305 | 1,636 | |
61 ; | | +------------------------------------------+
62 ; | +-------------> | |
63 ; | 1,532,990,889 | b1 [36 bytes] |
64 ; +-------------------------------> | |
65 ; +------------------------------------------+
67 ; An expected output with a large chain-split-threshold -- the layout score is
70 ; CHECK-LABEL: Applying ext-tsp layout
71 ; CHECK: original layout score: 23587612604815436.00
72 ; CHECK: optimized layout score: 27891096739311172.00
84 ; An expected output with chain-split-threshold=1 (disabling split point enumeration)
86 ; CHECK2-LABEL: Applying ext-tsp layout
87 ; CHECK2: original layout score: 23587612604815436.00
88 ; CHECK2: optimized layout score: 27891096739311172.00
100 ; An expected output with ext-tsp disabled -- the layout is not modified:
102 ; CHECK3-LABEL: func_large:
115 %0 = load i32, ptr @yydebug, align 4
116 %cmp = icmp ne i32 %0, 0
135 br i1 %cmp, label %b1, label %b2, !prof !1
157 br i1 %cmp, label %b3, label %b8, !prof !2
161 br i1 %cmp, label %b4, label %b8, !prof !3
165 br i1 %cmp, label %b5, label %b1, !prof !4
195 br i1 %cmp, label %b1, label %b6, !prof !5
204 br i1 %cmp, label %b7, label %b9, !prof !6
290 !0 = !{!"function_entry_count", i64 6131963556}
291 !1 = !{!"branch_weights", i32 3065981778, i32 3065981778}
292 !2 = !{!"branch_weights", i32 2299486333, i32 766495444}
293 !3 = !{!"branch_weights", i32 1532990888, i32 766495444}
294 !4 = !{!"branch_weights", i32 574871583, i32 958119305}
295 !5 = !{!"branch_weights", i32 574869946, i32 1636}
296 !6 = !{!"branch_weights", i32 1628, i32 7}