File: loop-inversion-pass.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (53 lines) | stat: -rw-r--r-- 1,642 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# REQUIRES: system-linux

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN:   %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: link_fdata %s %t.o %t.fdata2 "FDATA2"
# RUN: link_fdata %s %t.o %t.fdata3 "FDATA3"
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe --data %t.fdata --reorder-blocks=ext-tsp \
# RUN:    --print-finalized --loop-inversion-opt -o %t.out \
# RUN:    | FileCheck %s
# RUN: llvm-bolt %t.exe --data %t.fdata2 --reorder-blocks=ext-tsp \
# RUN:    --print-finalized --loop-inversion-opt -o %t.out2 \
# RUN:    | FileCheck --check-prefix="CHECK2" %s
# RUN: llvm-bolt %t.exe --data %t.fdata3 --reorder-blocks=none \
# RUN:    --print-finalized --loop-inversion-opt -o %t.out3 \
# RUN:    | FileCheck --check-prefix="CHECK3" %s

# The case where the loop is used:
# FDATA: 1 main 2 1 main #.J1# 0 420
# FDATA: 1 main b 1 main #.Jloop# 0 420
# FDATA: 1 main b 1 main d 0 1
# CHECK: BB Layout   : .LBB00, .Ltmp0, .Ltmp1, .LFT0

# The case where the loop is unused:
# FDATA2: 1 main 2 1 main #.J1# 0 420
# FDATA2: 1 main b 1 main #.Jloop# 0 1
# FDATA2: 1 main b 1 main d 0 420
# CHECK2: BB Layout   : .LBB00, .Ltmp1, .LFT0, .Ltmp0

# The case where the loop does not require rotation:
# FDATA3: 1 main 2 1 main #.J1# 0 420
# FDATA3: 1 main b 1 main #.Jloop# 0 420
# FDATA3: 1 main b 1 main d 0 1
# CHECK3: BB Layout   : .LBB00, .Ltmp0, .Ltmp1, .LFT0

    .text
    .globl main
    .type main, %function
    .size main, .Lend-main
main:
    xor %eax, %eax
    jmp .J1
.Jloop:
    inc %rax
.J1:
    cmp $16, %rax
    jl .Jloop
    retq

# For relocations against .text
    call exit
.Lend: