Home | History | Annotate | Download | only in ARM
      1 # RUN: llc -o - %s -mtriple=thumbv7-- -run-pass=stack-protector -run-pass=prologepilog | FileCheck %s
      2 ---
      3 # This should trigger an emergency spill in the register scavenger because the
      4 # frame offset into the large argument is too large.
      5 # CHECK-LABEL: name: func0
      6 # CHECK: t2STRi12 killed [[SPILLED:\$r[0-9]+]], $sp, 0, 14, $noreg :: (store 4 into %stack.0)
      7 # CHECK: [[SPILLED]] = t2ADDri killed $sp, 4096, 14, $noreg, $noreg
      8 # CHECK: $sp = t2LDRi12 killed [[SPILLED]], 40, 14, $noreg :: (load 4)
      9 # CHECK: [[SPILLED]] = t2LDRi12 $sp, 0, 14, $noreg :: (load 4 from %stack.0)
     10 name: func0
     11 tracksRegLiveness: true
     12 fixedStack:
     13   - { id: 0, offset: 4084, size: 4, alignment: 4, isImmutable: true,
     14       isAliased: false }
     15   - { id: 1, offset: -12, size: 4096, alignment: 4, isImmutable: false,
     16       isAliased: false }
     17 body: |
     18   bb.0:
     19     $r0 = IMPLICIT_DEF
     20     $r1 = IMPLICIT_DEF
     21     $r2 = IMPLICIT_DEF
     22     $r3 = IMPLICIT_DEF
     23     $r4 = IMPLICIT_DEF
     24     $r5 = IMPLICIT_DEF
     25     $r6 = IMPLICIT_DEF
     26     $r7 = IMPLICIT_DEF
     27     $r8 = IMPLICIT_DEF
     28     $r9 = IMPLICIT_DEF
     29     $r10 = IMPLICIT_DEF
     30     $r11 = IMPLICIT_DEF
     31     $r12 = IMPLICIT_DEF
     32     $lr = IMPLICIT_DEF
     33 
     34     $sp = t2LDRi12 %fixed-stack.0, 0, 14, $noreg :: (load 4)
     35 
     36     KILL $r0
     37     KILL $r1
     38     KILL $r2
     39     KILL $r3
     40     KILL $r4
     41     KILL $r5
     42     KILL $r6
     43     KILL $r7
     44     KILL $r8
     45     KILL $r9
     46     KILL $r10
     47     KILL $r11
     48     KILL $r12
     49     KILL $lr
     50 ...
     51 ---
     52 # This should not trigger an emergency spill yet.
     53 # CHECK-LABEL: name: func1
     54 # CHECK-NOT: t2STRi12
     55 # CHECK-NOT: t2ADDri
     56 # CHECK: $r11 = t2LDRi12 $sp, 4092, 14, $noreg :: (load 4)
     57 # CHECK-NOT: t2LDRi12
     58 name: func1
     59 tracksRegLiveness: true
     60 fixedStack:
     61   - { id: 0, offset: 4044, size: 4, alignment: 4, isImmutable: true,
     62       isAliased: false }
     63   - { id: 1, offset: -12, size: 4056, alignment: 4, isImmutable: false,
     64       isAliased: false }
     65 body: |
     66   bb.0:
     67     $r0 = IMPLICIT_DEF
     68     $r1 = IMPLICIT_DEF
     69     $r2 = IMPLICIT_DEF
     70     $r3 = IMPLICIT_DEF
     71     $r4 = IMPLICIT_DEF
     72     $r5 = IMPLICIT_DEF
     73     $r6 = IMPLICIT_DEF
     74     $r8 = IMPLICIT_DEF
     75     $r9 = IMPLICIT_DEF
     76     $r10 = IMPLICIT_DEF
     77     $r11 = IMPLICIT_DEF
     78     $r12 = IMPLICIT_DEF
     79     $lr = IMPLICIT_DEF
     80 
     81     $r11 = t2LDRi12 %fixed-stack.0, 0, 14, $noreg :: (load 4)
     82 
     83     KILL $r0
     84     KILL $r1
     85     KILL $r2
     86     KILL $r3
     87     KILL $r4
     88     KILL $r5
     89     KILL $r6
     90     KILL $r8
     91     KILL $r9
     92     KILL $r10
     93     KILL $r11
     94     KILL $r12
     95     KILL $lr
     96 ...
     97