xref: /llvm-project-15.0.7/bolt/test/X86/loop-inversion-pass.s (revision 679f8a88)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: system-linux
2
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: link_fdata %s %t.o %t.fdata2 "FDATA2"
7# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
8# RUN: llvm-bolt %t.exe -data %t.fdata -reorder-blocks=cache+ -print-finalized \
9# RUN:    -loop-inversion-opt -o %t.out | FileCheck %s
10# RUN: llvm-bolt %t.exe -data %t.fdata2 -reorder-blocks=cache+ -print-finalized \
11# RUN:    -loop-inversion-opt -o %t.out2 | FileCheck --check-prefix="CHECK2" %s
12
13# The case where loop is used:
14# FDATA: 1 main 2 1 main #.J1# 0 420
15# FDATA: 1 main b 1 main #.Jloop# 0 420
16# FDATA: 1 main b 1 main d 0 1
17# CHECK: BB Layout   : .LBB00, .Ltmp0, .Ltmp1, .LFT0
18
19# The case where loop is unused:
20# FDATA2: 1 main 2 1 main #.J1# 0 420
21# FDATA2: 1 main b 1 main #.Jloop# 0 1
22# FDATA2: 1 main b 1 main d 0 420
23# CHECK2: BB Layout   : .LBB00, .Ltmp1, .LFT0, .Ltmp0
24
25    .text
26    .globl main
27    .type main, %function
28    .size main, .Lend-main
29main:
30    xor %eax, %eax
31    jmp .J1
32.Jloop:
33    inc %rax
34.J1:
35    cmp $16, %rax
36    jl .Jloop
37    retq
38.Lend:
39

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026