Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / tail-duplication-pass.s
blobed50cc5227d8557dc39a71db4a5b481c71f9971a
1 # REQUIRES: system-linux
3 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
4 # RUN: %s -o %t.o
5 # RUN: link_fdata %s %t.o %t.fdata
6 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
7 # RUN: llvm-bolt %t.exe --data %t.fdata --reorder-blocks=ext-tsp \
8 # RUN: --print-finalized --tail-duplication=moderate \
9 # RUN: --tail-duplication-minimum-offset=1 -o %t.out | FileCheck %s
10 # RUN: llvm-bolt %t.exe --data %t.fdata --print-finalized \
11 # RUN: --tail-duplication=aggressive --tail-duplication-minimum-offset=1 \
12 # RUN: -o %t.out | FileCheck %s --check-prefix CHECK-NOLOOP
14 # FDATA: 1 main 2 1 main #.BB2# 0 10
15 # FDATA: 1 main 4 1 main #.BB2# 0 20
16 # CHECK: BOLT-INFO: tail duplication modified 1 ({{.*}}%) functions; duplicated 1 blocks (1 bytes) responsible for {{.*}} dynamic executions ({{.*}}% of all block executions)
17 # CHECK: BB Layout : .LBB00, .Ltail-dup0, .Ltmp0, .Ltmp1
19 # Check that the successor of Ltail-dup0 is .LBB00, not itself.
20 # CHECK-NOLOOP: .Ltail-dup0 (1 instructions, align : 1)
21 # CHECK-NOLOOP: Predecessors: .LBB00
22 # CHECK-NOLOOP: retq
23 # CHECK-NOLOOP: .Ltmp0 (1 instructions, align : 1)
25 .text
26 .globl main
27 .type main, %function
28 .size main, .Lend-main
29 main:
30 xor %eax, %eax
31 jmp .BB2
32 .BB1:
33 inc %rax
34 .BB2:
35 retq
36 # For relocations against .text
37 call exit
38 .Lend: