reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    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
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
# RUN: llc -o - %s -mtriple=thumbv7-- -run-pass=stack-protector -run-pass=prologepilog | FileCheck %s
---
# This should trigger an emergency spill in the register scavenger because the
# frame offset into the large argument is too large.
# CHECK-LABEL: name: func0
# CHECK: t2STRi12 killed [[SPILLED:\$r[0-9]+]], $sp, 0, 14, $noreg :: (store 4 into %stack.0)
# CHECK: [[SPILLED]] = t2ADDri killed $sp, 4096, 14, $noreg, $noreg
# CHECK: $sp = t2LDRi12 killed [[SPILLED]], 40, 14, $noreg :: (load 4)
# CHECK: [[SPILLED]] = t2LDRi12 $sp, 0, 14, $noreg :: (load 4 from %stack.0)
name: func0
tracksRegLiveness: true
fixedStack:
  - { id: 0, offset: 4084, size: 4, alignment: 4, isImmutable: true,
      isAliased: false }
  - { id: 1, offset: -12, size: 4096, alignment: 4, isImmutable: false,
      isAliased: false }
body: |
  bb.0:
    $r0 = IMPLICIT_DEF
    $r1 = IMPLICIT_DEF
    $r2 = IMPLICIT_DEF
    $r3 = IMPLICIT_DEF
    $r4 = IMPLICIT_DEF
    $r5 = IMPLICIT_DEF
    $r6 = IMPLICIT_DEF
    $r7 = IMPLICIT_DEF
    $r8 = IMPLICIT_DEF
    $r9 = IMPLICIT_DEF
    $r10 = IMPLICIT_DEF
    $r11 = IMPLICIT_DEF
    $r12 = IMPLICIT_DEF
    $lr = IMPLICIT_DEF

    $sp = t2LDRi12 %fixed-stack.0, 0, 14, $noreg :: (load 4)

    KILL $r0
    KILL $r1
    KILL $r2
    KILL $r3
    KILL $r4
    KILL $r5
    KILL $r6
    KILL $r7
    KILL $r8
    KILL $r9
    KILL $r10
    KILL $r11
    KILL $r12
    KILL $lr
...
---
# This should not trigger an emergency spill yet.
# CHECK-LABEL: name: func1
# CHECK-NOT: t2STRi12
# CHECK-NOT: t2ADDri
# CHECK: $r11 = t2LDRi12 $sp, 4092, 14, $noreg :: (load 4)
# CHECK-NOT: t2LDRi12
name: func1
tracksRegLiveness: true
fixedStack:
  - { id: 0, offset: 4044, size: 4, alignment: 4, isImmutable: true,
      isAliased: false }
  - { id: 1, offset: -12, size: 4056, alignment: 4, isImmutable: false,
      isAliased: false }
body: |
  bb.0:
    $r0 = IMPLICIT_DEF
    $r1 = IMPLICIT_DEF
    $r2 = IMPLICIT_DEF
    $r3 = IMPLICIT_DEF
    $r4 = IMPLICIT_DEF
    $r5 = IMPLICIT_DEF
    $r6 = IMPLICIT_DEF
    $r8 = IMPLICIT_DEF
    $r9 = IMPLICIT_DEF
    $r10 = IMPLICIT_DEF
    $r11 = IMPLICIT_DEF
    $r12 = IMPLICIT_DEF
    $lr = IMPLICIT_DEF

    $r11 = t2LDRi12 %fixed-stack.0, 0, 14, $noreg :: (load 4)

    KILL $r0
    KILL $r1
    KILL $r2
    KILL $r3
    KILL $r4
    KILL $r5
    KILL $r6
    KILL $r8
    KILL $r9
    KILL $r10
    KILL $r11
    KILL $r12
    KILL $lr
...