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
# RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner \
# RUN: -verify-machineinstrs %s -o - | FileCheck %s

# Ensure that we never outline calls into sequences where unsafe stack
# instructions are present.

--- |
  define void @foo() #0 { ret void }
  define void @bar() #0 { ret void }
  define void @baz() #0 { ret void }
  define void @f1() #0 { ret void }
  define void @f2() #0 { ret void }
  attributes #0 = { minsize noinline noredzone "no-frame-pointer-elim"="true" }
...
---

name:            f1
tracksRegLiveness: true
body:             |
  bb.0:
  liveins: $lr
    ; CHECK-LABEL: name:            f1
    ; CHECK: foo
    ; CHECK-DAG: bar
    ; CHECK-DAG: baz
    $lr = ORRXri $xzr, 1
    BL @foo, implicit-def dead $lr, implicit $sp
    $x20, $x19 = LDPXi $sp, 255
    $x20, $x19 = LDPXi $sp, 255
    $x20, $x19 = LDPXi $sp, 255
    $x20, $x19 = LDPXi $sp, 255
  bb.1:
    BL @bar, implicit-def dead $lr, implicit $sp
    $x11 = ADDXri $sp, 48, 0;
    $x12 = ADDXri $sp, 48, 0;
    $x13 = ADDXri $sp, 48, 0;
    $x14 = ADDXri $sp, 48, 0;
  bb.2:
    BL @baz, implicit-def dead $lr, implicit $sp
    $x0 = ADDXri $sp, 48, 0;
    $x1 = ADDXri $sp, 48, 0;
    RET undef $lr

...
---

name:            f2
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $lr
    ; CHECK-LABEL: name:            f2
    ; CHECK: foo
    ; CHECK-DAG: bar
    ; CHECK-DAG: baz
    $lr = ORRXri $xzr, 1
    BL @foo, implicit-def dead $lr, implicit $sp
    $x20, $x19 = LDPXi $sp, 255
    $x20, $x19 = LDPXi $sp, 255
    $x20, $x19 = LDPXi $sp, 255
    $x20, $x19 = LDPXi $sp, 255
  bb.1:
    BL @bar, implicit-def dead $lr, implicit $sp
    $x11 = ADDXri $sp, 48, 0;
    $x12 = ADDXri $sp, 48, 0;
    $x13 = ADDXri $sp, 48, 0;
    $x14 = ADDXri $sp, 48, 0;
  bb.2:
    BL @baz, implicit-def dead $lr, implicit $sp
    $x0 = ADDXri $sp, 48, 0;
    $x1 = ADDXri $sp, 48, 0;
    RET undef $lr