File: nonreserved-callframe-with-basereg.mir

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (54 lines) | stat: -rw-r--r-- 1,769 bytes parent folder | download | duplicates (19)
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
# RUN: llc -run-pass=prologepilog %s -o -  | FileCheck %s

# Make sure we use the correct offset for stack accesses using the base pointer
# within call frame blocks. Key points of test:
#    + A large SP in ADJCALLSTACKDOWN forces each call to get its own adjustment.
#    + An over-aligned stack variable means that we must use r6 rather than fp
#      to access this variables.
#
# Under these circumstances, the ADJCALLSTACKDOWN must not apply to r6 offsets.

--- |
  ; ModuleID = 'simple.ll'
  source_filename = "simple.ll"
  target datalayout = "e-m:o-p:32:32-i64:64-a:0:32-n32-S128"
  target triple = "thumbv7k-apple-ios"

  declare void @bar([4 x i32], i32)

  define void @foo(i32 %n) {
    ret void
  }

...
---
name:            foo
liveins:
  - { reg: '$r0', virtual-reg: '' }
frameInfo:
  adjustsStack:    true
  hasCalls:        true
  maxCallFrameSize: 2276
stack:
  - { id: 0, name: '', type: spill-slot, offset: 0, alignment: 32,  size: 4 }
constants:       []
body:             |
  bb.0 (%ir-block.0):
    liveins: $r0

    ; CHECK: t2STRi12 killed $r0, $r6, [[OFFSET:[0-9]+]]
    t2STRi12 killed $r0, %stack.0, 0, 14, $noreg :: (store (s32) into %stack.0)

    ADJCALLSTACKDOWN 2276, 0, 14, $noreg, implicit-def dead $sp, implicit $sp

    ; CHECK: renamable $r0 = t2LDRi12 $r6, [[OFFSET]]
    renamable $r0 = t2LDRi12 %stack.0, 0, 14, $noreg, :: (load (s32) from %stack.0)
    renamable $r1 = IMPLICIT_DEF
    renamable $r2 = IMPLICIT_DEF
    renamable $r3 = IMPLICIT_DEF
    tBL 14, $noreg, @bar, csr_ios, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit killed $r2, implicit killed $r3, implicit-def $sp

    ADJCALLSTACKUP 2276, 0, 14, $noreg, implicit-def dead $sp, implicit $sp
    tBX_RET 14, $noreg

...