1 # Tests whether llvm-bolt is able to reorder blocks and fix branches
2 # according to the new function layout.
4 RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
5 RUN: llvm-bolt %t.exe -o /dev/null --data %p/Inputs/blarge.fdata \
6 RUN: --reorder-blocks=normal --print-finalized 2>&1 | FileCheck %s \
7 RUN: --check-prefix=CHECK
9 CHECK: Binary Function "usqrt"
10 CHECK: BB Layout : .LBB{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .LFT{{.*}}
12 CHECK: Exec Count : 199
13 CHECK: {{.*}}: movl $0x20, %r8d
14 CHECK: {{.*}}: xorl %eax, %eax
15 CHECK: {{.*}}: xorl %edx, %edx
16 CHECK: {{.*}}: jmp .Ltmp{{.*}}
17 CHECK: Successors: .Ltmp{{.*}} (mispreds: 0, count: 0)
19 CHECK: Exec Count : 4711
20 CHECK: Predecessors: .Ltmp{{.*}}, .LFT{{.*}}
21 CHECK: {{.*}}: subl $0x1, %r8d
22 CHECK: {{.*}}: je .LFT{{.*}}
23 CHECK: Successors: .LFT{{.*}} (mispreds: 0, count: 0), .Ltmp{{.*}} (mispreds: 33, count: 4711)
25 CHECK: Exec Count : 4711
26 CHECK: Predecessors: .Ltmp{{.*}}, .LBB{{.*}}
27 CHECK: {{.*}}: movq %rdi, %rcx
28 CHECK: {{.*}}: addq %rax, %rax
29 CHECK: {{.*}}: shlq $0x2, %rdi
30 CHECK: {{.*}}: andl $0xc0000000, %ecx
31 CHECK: {{.*}}: shrq $0x1e, %rcx
32 CHECK: {{.*}}: leaq (%rcx,%rdx,4), %rdx
33 CHECK: {{.*}}: leaq 0x1(%rax,%rax), %rcx
34 CHECK: {{.*}}: cmpq %rcx, %rdx
35 CHECK: {{.*}}: jb .Ltmp{{.*}}
36 CHECK: Successors: .Ltmp{{.*}} (mispreds: 171, count: 2886), .LFT{{.*}} (mispreds: 0, count: 0)
39 CHECK: Predecessors: .Ltmp{{.*}}
40 CHECK: {{.*}}: subq %rcx, %rdx
41 CHECK: {{.*}}: addq $0x1, %rax
42 CHECK: {{.*}}: jmp .Ltmp{{.*}}
43 CHECK: Successors: .Ltmp{{.*}} (mispreds: 0, count: 0)
46 CHECK: Predecessors: .Ltmp{{.*}}
47 CHECK: {{.*}}: movq %rax, (%rsi)