File: fp-vla-callee-saved.ll

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 (60 lines) | stat: -rw-r--r-- 1,634 bytes parent folder | download | duplicates (3)
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
54
55
56
57
58
59
60
; RUN: llc -O0 -frame-pointer=all < %s | FileCheck %s

; Check that CFI instructions are generated properly when
; a frame pointer, variable length array and callee-saved
; registers are all present at the same time

target datalayout = "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16"
target triple = "msp430-unknown-unknown-elf"

@g = global float 0.0
@N = external global i16, align 2

define void @foo() {
; CHECK-LABEL: foo:
; CHECK: push  r4
; CHECK-NEXT: .cfi_def_cfa_offset 4
; CHECK-NEXT: .cfi_offset r4, -4
; CHECK-NEXT: mov r1, r4
; CHECK-NEXT: .cfi_def_cfa_register r4
; CHECK: push  r6
; CHECK-NEXT: push  r7
; CHECK-NEXT: push  r8
; CHECK-NEXT: push  r9
; CHECK-NEXT: push  r10
; CHECK: .cfi_offset r6, -6
; CHECK: .cfi_offset r7, -8
; CHECK: .cfi_offset r8, -10
; CHECK: .cfi_offset r9, -12
; CHECK: .cfi_offset r10, -14

  %n = load i16, ptr @N, align 2
  %vla = alloca i8, i16 %n, align 1
  %t1 = load volatile float, float* @g
  %t2 = load volatile float, float* @g
  %t3 = load volatile float, float* @g
  %t4 = load volatile float, float* @g
  %t5 = load volatile float, float* @g
  store volatile float %t1, float* @g
  store volatile float %t2, float* @g
  store volatile float %t3, float* @g
  store volatile float %t4, float* @g
  store volatile float %t5, float* @g
  
; CHECK: mov r4, r1
; CHECK-NEXT: sub #10, r1
; CHECK: pop r10
; CHECK-NEXT: pop r9
; CHECK-NEXT: pop r8
; CHECK-NEXT: pop r7
; CHECK-NEXT: pop r6
; CHECK: pop r4
; CHECK: .cfi_def_cfa r1, 2
; CHECK: .cfi_restore r6
; CHECK: .cfi_restore r7
; CHECK: .cfi_restore r8
; CHECK: .cfi_restore r9
; CHECK: .cfi_restore r10

  ret void
}