machine-outliner-no-lr-save.mir 4.27 KB
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=arm-- -run-pass=machine-outliner -verify-machineinstrs \
# RUN: %s -o - | FileCheck %s

--- |
  define void @outline_no_save_ok_arm() #0 { ret void }
  define void @outline_no_save_ko_arm() #0 { ret void }
  define void @outline_no_save_ok_thumb() #1 { ret void }
  define void @outline_no_save_ko_thumb() #1 { ret void }

  declare void @foo()

  attributes #0 = { minsize optsize }
  attributes #1 = { minsize optsize "target-features"="+armv7-a,+thumb-mode" }
...
---

name:           outline_no_save_ok_arm
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: outline_no_save_ok_arm
  ; CHECK: bb.0:
  ; CHECK:   BL @OUTLINED_FUNCTION_1
  ; CHECK: bb.1:
  ; CHECK:   BL @OUTLINED_FUNCTION_1
  ; CHECK: bb.2:
  ; CHECK:   BX_RET 14 /* CC::al */, $noreg
  bb.0:
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r3 = LDRi12 $sp, 8, 14, $noreg
  bb.1:
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r2 = MOVi 1, 14, $noreg, $noreg
    $r3 = LDRi12 $sp, 8, 14, $noreg
  bb.2:
    BX_RET 14, $noreg
...
---

name:           outline_no_save_ko_arm
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: outline_no_save_ko_arm
  ; CHECK-NOT: OUTLINED_FUNCTION
  bb.0:
    liveins: $lr
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r3 = LDRi12 $sp, 8, 14, $noreg
    $r2 = MOVr $lr, 14, $noreg, $noreg
  bb.1:
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r2 = MOVi 2, 14, $noreg, $noreg
    $r3 = LDRi12 $sp, 8, 14, $noreg
    $r4 = MOVi 4, 14, $noreg, $noreg
    BL @foo
  bb.2:
    liveins: $lr
    BX_RET 14, $noreg
...
---

name:           outline_no_save_ok_thumb
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: outline_no_save_ok_thumb
  ; CHECK: bb.0:
  ; CHECK:   tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_0
  ; CHECK: bb.1:
  ; CHECK:   tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_0
  ; CHECK: bb.2:
  ; CHECK:   tBX_RET 14 /* CC::al */, $noreg
  bb.0:
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    t2STRi12 $r2, $sp, 0, 14, $noreg
  bb.1:
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    $r2 = t2MOVi 1, 14, $noreg, $noreg
    t2STRi12 $r2, $sp, 0, 14, $noreg
  bb.2:
    tBX_RET 14, $noreg
...
---

name:           outline_no_save_ko_thumb
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: outline_no_save_ko_thumb
  ; CHECK-NOT: OUTLINED_FUNCTION
  bb.0:
    liveins: $lr
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    t2STRi12 $r2, $sp, 0, 14, $noreg
    $r2 = tMOVr $lr, 14, $noreg
  bb.1:
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    $r2 = t2MOVi 2, 14, $noreg, $noreg
    t2STRi12 $r2, $sp, 0, 14, $noreg
    $r4 = t2MOVi 3, 14, $noreg, $noreg
    tBL 14, $noreg, @foo
  bb.2:
    liveins: $lr, $r0, $r6, $r7, $r8, $r9, $r10, $r11
    tBX_RET 14, $noreg

  ; CHECK-LABEL: name: OUTLINED_FUNCTION_0
  ; CHECK: bb.0:
  ; CHECK:   $r2 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   $r2 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   $r2 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   $r2 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   t2STRi12 $r2, $sp, 0, 14 /* CC::al */, $noreg
  ; CHECK:   tBX_RET 14 /* CC::al */, $noreg

  ; CHECK-LABEL: name: OUTLINED_FUNCTION_1
  ; CHECK: bb.0:
  ; CHECK:   $r2 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   $r2 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   $r2 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   $r2 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   $r3 = LDRi12 $sp, 8, 14 /* CC::al */, $noreg
  ; CHECK:   MOVPCLR 14 /* CC::al */, $noreg