1 # Checks that llvm-bolt is able to read data generated by perf2bolt and update
2 # the CFG edges accordingly with absolute number of branches and mispredictions.
3 # Also checks that llvm-bolt disassembler and CFG builder is working properly.
5 RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
6 RUN: llvm-bolt %t.exe -o %t.null --data %p/Inputs/blarge.fdata --print-cfg | FileCheck %s
8 CHECK: Binary Function "usqrt"
9 CHECK: State : CFG constructed
10 CHECK: Address : 0x401170
14 CHECK: Section : .text
17 CHECK: Exec Count : 199
18 CHECK: Branch Count: 7689
21 CHECK: Exec Count : 199
22 CHECK: {{.*}}: movl $0x20, %r8d
23 CHECK: {{.*}}: xorl %eax, %eax
24 CHECK: {{.*}}: xorl %edx, %edx
25 CHECK: Successors: .Ltmp{{.*}} (mispreds: 0, count: 0)
27 CHECK: Exec Count : 4711
28 CHECK: Predecessors: .Ltmp{{.*}}, .LBB{{.*}}
29 CHECK: {{.*}}: movq %rdi, %rcx
30 CHECK: {{.*}}: addq %rax, %rax
31 CHECK: {{.*}}: shlq $0x2, %rdi
32 CHECK: {{.*}}: andl $0xc0000000, %ecx
33 CHECK: {{.*}}: shrq $0x1e, %rcx
34 CHECK: {{.*}}: leaq (%rcx,%rdx,4), %rdx
35 CHECK: {{.*}}: leaq 0x1(%rax,%rax), %rcx
36 CHECK: {{.*}}: cmpq %rcx, %rdx
37 CHECK: {{.*}}: jb .Ltmp{{.*}}
38 CHECK: Successors: .Ltmp{{.*}} (mispreds: 171, count: 2886), .LFT{{.*}} (mispreds: 0, count: 0)
41 CHECK: Predecessors: .Ltmp{{.*}}
42 CHECK: {{.*}}: subq %rcx, %rdx
43 CHECK: {{.*}}: addq $0x1, %rax
44 CHECK: Successors: .Ltmp{{.*}} (mispreds: 0, count: 0)
46 CHECK: Exec Count : 4711
47 CHECK: Predecessors: .Ltmp{{.*}}, .LFT{{.*}}
48 CHECK: {{.*}}: subl $0x1, %r8d
49 CHECK: {{.*}}: jne .Ltmp{{.*}}
50 CHECK: Successors: .Ltmp{{.*}} (mispreds: 33, count: 4711), .LFT{{.*}} (mispreds: 0, count: 0)
53 CHECK: Predecessors: .Ltmp{{.*}}
54 CHECK: {{.*}}: movq %rax, (%rsi)
56 CHECK: End of Function "usqrt"