1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/ARM/machine-outliner-default.mir
Yvan Roux 014e02db94 [ARM][MachineOutliner] Add default mode.
Use the stack to save and restore the link register when there is no
available register to do it.

Differential Revision: https://reviews.llvm.org/D76069
2020-08-20 09:25:33 +02:00

370 lines
15 KiB
YAML

# 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_default_arm() #0 { ret void }
define void @outline_default_thumb() #1 { ret void }
define void @outline_default_KO_call_arm() #0 { ret void }
define void @outline_default_KO_call_thumb() #1 { ret void }
define void @outline_default_KO_stack_arm() #0 { ret void }
define void @outline_default_KO_stack_thumb() #0 { ret void }
declare void @bar()
attributes #0 = { minsize optsize }
attributes #1 = { minsize optsize "target-features"="+armv7-a,+thumb-mode" }
...
---
name: outline_default_arm
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: outline_default_arm
; CHECK: bb.0:
; CHECK: liveins: $lr
; CHECK: early-clobber $sp = STR_PRE_IMM killed $lr, $sp, -8, 14 /* CC::al */, $noreg
; CHECK: BL @OUTLINED_FUNCTION_0
; CHECK: $lr, $sp = LDR_POST_IMM $sp, $noreg, 8, 14 /* CC::al */, $noreg
; CHECK: bb.1:
; CHECK: liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: early-clobber $sp = STR_PRE_IMM killed $lr, $sp, -8, 14 /* CC::al */, $noreg
; CHECK: BL @OUTLINED_FUNCTION_0
; CHECK: $lr, $sp = LDR_POST_IMM $sp, $noreg, 8, 14 /* CC::al */, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: early-clobber $sp = STR_PRE_IMM killed $lr, $sp, -8, 14 /* CC::al */, $noreg
; CHECK: BL @OUTLINED_FUNCTION_0
; CHECK: $lr, $sp = LDR_POST_IMM $sp, $noreg, 8, 14 /* CC::al */, $noreg
; CHECK: bb.3:
; CHECK: liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r2 = MOVr $lr, 14 /* CC::al */, $noreg, $noreg
; CHECK: BX_RET 14 /* CC::al */, $noreg
bb.0:
liveins: $lr
$r0 = MOVi 1, 14, $noreg, $noreg
$r1 = MOVi 1, 14, $noreg, $noreg
$r2 = MOVi 1, 14, $noreg, $noreg
$r3 = MOVi 1, 14, $noreg, $noreg
$r4 = MOVi 1, 14, $noreg, $noreg
$r5 = MOVi 1, 14, $noreg, $noreg
bb.1:
liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = MOVi 1, 14, $noreg, $noreg
$r1 = MOVi 1, 14, $noreg, $noreg
$r2 = MOVi 1, 14, $noreg, $noreg
$r3 = MOVi 1, 14, $noreg, $noreg
$r4 = MOVi 1, 14, $noreg, $noreg
$r5 = MOVi 1, 14, $noreg, $noreg
bb.2:
liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = MOVi 1, 14, $noreg, $noreg
$r1 = MOVi 1, 14, $noreg, $noreg
$r2 = MOVi 1, 14, $noreg, $noreg
$r3 = MOVi 1, 14, $noreg, $noreg
$r4 = MOVi 1, 14, $noreg, $noreg
$r5 = MOVi 1, 14, $noreg, $noreg
bb.3:
liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
$r2 = MOVr $lr, 14, $noreg, $noreg
BX_RET 14, $noreg
...
---
name: outline_default_thumb
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: outline_default_thumb
; CHECK: bb.0:
; CHECK: liveins: $lr
; CHECK: early-clobber $sp = t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
; CHECK: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_1
; CHECK: $lr, $sp = t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
; CHECK: bb.1:
; CHECK: liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: early-clobber $sp = t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
; CHECK: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_1
; CHECK: $lr, $sp = t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: early-clobber $sp = t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
; CHECK: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_1
; CHECK: $lr, $sp = t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
; CHECK: bb.3:
; CHECK: liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r2 = tMOVr $lr, 14 /* CC::al */, $noreg
; CHECK: tBX_RET 14 /* CC::al */, $noreg
bb.0:
liveins: $lr
$r0 = t2MOVi 1, 14, $noreg, $noreg
$r1 = t2MOVi 1, 14, $noreg, $noreg
$r2 = t2MOVi 1, 14, $noreg, $noreg
$r3 = t2MOVi 1, 14, $noreg, $noreg
bb.1:
liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = t2MOVi 1, 14, $noreg, $noreg
$r1 = t2MOVi 1, 14, $noreg, $noreg
$r2 = t2MOVi 1, 14, $noreg, $noreg
$r3 = t2MOVi 1, 14, $noreg, $noreg
bb.2:
liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = t2MOVi 1, 14, $noreg, $noreg
$r1 = t2MOVi 1, 14, $noreg, $noreg
$r2 = t2MOVi 1, 14, $noreg, $noreg
$r3 = t2MOVi 1, 14, $noreg, $noreg
bb.3:
liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r2 = tMOVr $lr, 14, $noreg
tBX_RET 14, $noreg
...
---
name: outline_default_KO_call_arm
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: outline_default_KO_call_arm
; CHECK: bb.0:
; CHECK: liveins: $lr
; CHECK: BL @bar, implicit-def dead $lr, implicit $sp
; CHECK: $r0 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r4 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.1:
; CHECK: liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: BL @bar, implicit-def dead $lr, implicit $sp
; CHECK: $r0 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r4 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: BL @bar, implicit-def dead $lr, implicit $sp
; CHECK: $r0 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r4 = MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.3:
; CHECK: liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r2 = MOVr $lr, 14 /* CC::al */, $noreg, $noreg
; CHECK: BX_RET 14 /* CC::al */, $noreg
bb.0:
liveins: $lr
BL @bar, implicit-def dead $lr, implicit $sp
$r0 = MOVi 2, 14, $noreg, $noreg
$r1 = MOVi 2, 14, $noreg, $noreg
$r2 = MOVi 2, 14, $noreg, $noreg
$r3 = MOVi 2, 14, $noreg, $noreg
$r4 = MOVi 2, 14, $noreg, $noreg
bb.1:
liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
BL @bar, implicit-def dead $lr, implicit $sp
$r0 = MOVi 2, 14, $noreg, $noreg
$r1 = MOVi 2, 14, $noreg, $noreg
$r2 = MOVi 2, 14, $noreg, $noreg
$r3 = MOVi 2, 14, $noreg, $noreg
$r4 = MOVi 2, 14, $noreg, $noreg
bb.2:
liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
BL @bar, implicit-def dead $lr, implicit $sp
$r0 = MOVi 2, 14, $noreg, $noreg
$r1 = MOVi 2, 14, $noreg, $noreg
$r2 = MOVi 2, 14, $noreg, $noreg
$r3 = MOVi 2, 14, $noreg, $noreg
$r4 = MOVi 2, 14, $noreg, $noreg
bb.3:
liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r2 = MOVr $lr, 14, $noreg, $noreg
BX_RET 14, $noreg
...
---
name: outline_default_KO_call_thumb
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: outline_default_KO_call_thumb
; CHECK: bb.0:
; CHECK: liveins: $lr
; CHECK: tBL 14 /* CC::al */, $noreg, @bar, implicit-def dead $lr, implicit $sp
; CHECK: $r0 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.1:
; CHECK: liveins: $lr, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: tBL 14 /* CC::al */, $noreg, @bar, implicit-def dead $lr, implicit $sp
; CHECK: $r0 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: tBL 14 /* CC::al */, $noreg, @bar, implicit-def dead $lr, implicit $sp
; CHECK: $r0 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = t2MOVi 2, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.3:
; CHECK: liveins: $lr, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r2 = tMOVr $lr, 14 /* CC::al */, $noreg
; CHECK: tBX_RET 14 /* CC::al */, $noreg
bb.0:
liveins: $lr
tBL 14, $noreg, @bar, implicit-def dead $lr, implicit $sp
$r0 = t2MOVi 2, 14, $noreg, $noreg
$r1 = t2MOVi 2, 14, $noreg, $noreg
$r2 = t2MOVi 2, 14, $noreg, $noreg
bb.1:
liveins: $lr, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
tBL 14, $noreg, @bar, implicit-def dead $lr, implicit $sp
$r0 = t2MOVi 2, 14, $noreg, $noreg
$r1 = t2MOVi 2, 14, $noreg, $noreg
$r2 = t2MOVi 2, 14, $noreg, $noreg
bb.2:
liveins: $lr, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
tBL 14, $noreg, @bar, implicit-def dead $lr, implicit $sp
$r0 = t2MOVi 2, 14, $noreg, $noreg
$r1 = t2MOVi 2, 14, $noreg, $noreg
$r2 = t2MOVi 2, 14, $noreg, $noreg
bb.3:
liveins: $lr, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r2 = tMOVr $lr, 14, $noreg
tBX_RET 14, $noreg
...
---
name: outline_default_KO_stack_arm
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: outline_default_KO_stack_arm
; CHECK: bb.0:
; CHECK: liveins: $lr
; CHECK: $r0 = LDRi12 $sp, 0, 14 /* CC::al */, $noreg
; CHECK: $r1 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r4 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r5 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.1:
; CHECK: liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r0 = LDRi12 $sp, 0, 14 /* CC::al */, $noreg
; CHECK: $r1 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r4 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r5 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r0 = LDRi12 $sp, 0, 14 /* CC::al */, $noreg
; CHECK: $r1 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r4 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r5 = MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.3:
; CHECK: liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r2 = MOVr $lr, 14 /* CC::al */, $noreg, $noreg
; CHECK: BX_RET 14 /* CC::al */, $noreg
bb.0:
liveins: $lr
$r0 = LDRi12 $sp, 0, 14, $noreg
$r1 = MOVi 3, 14, $noreg, $noreg
$r2 = MOVi 3, 14, $noreg, $noreg
$r3 = MOVi 3, 14, $noreg, $noreg
$r4 = MOVi 3, 14, $noreg, $noreg
$r5 = MOVi 3, 14, $noreg, $noreg
bb.1:
liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = LDRi12 $sp, 0, 14, $noreg
$r1 = MOVi 3, 14, $noreg, $noreg
$r2 = MOVi 3, 14, $noreg, $noreg
$r3 = MOVi 3, 14, $noreg, $noreg
$r4 = MOVi 3, 14, $noreg, $noreg
$r5 = MOVi 3, 14, $noreg, $noreg
bb.2:
liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = LDRi12 $sp, 0, 14, $noreg
$r1 = MOVi 3, 14, $noreg, $noreg
$r2 = MOVi 3, 14, $noreg, $noreg
$r3 = MOVi 3, 14, $noreg, $noreg
$r4 = MOVi 3, 14, $noreg, $noreg
$r5 = MOVi 3, 14, $noreg, $noreg
bb.3:
liveins: $lr, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r2 = MOVr $lr, 14, $noreg, $noreg
BX_RET 14, $noreg
...
---
name: outline_default_KO_stack_thumb
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: outline_default_KO_stack_thumb
; CHECK: bb.0:
; CHECK: liveins: $lr
; CHECK: $r0 = t2LDRi12 $sp, 0, 14 /* CC::al */, $noreg
; CHECK: $r1 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.1:
; CHECK: liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r0 = t2LDRi12 $sp, 0, 14 /* CC::al */, $noreg
; CHECK: $r1 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r0 = t2LDRi12 $sp, 0, 14 /* CC::al */, $noreg
; CHECK: $r1 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = t2MOVi 3, 14 /* CC::al */, $noreg, $noreg
; CHECK: bb.3:
; CHECK: liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r2 = tMOVr $lr, 14 /* CC::al */, $noreg
; CHECK: tBX_RET 14 /* CC::al */, $noreg
bb.0:
liveins: $lr
$r0 = t2LDRi12 $sp, 0, 14, $noreg
$r1 = t2MOVi 3, 14, $noreg, $noreg
$r2 = t2MOVi 3, 14, $noreg, $noreg
$r3 = t2MOVi 3, 14, $noreg, $noreg
bb.1:
liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = t2LDRi12 $sp, 0, 14, $noreg
$r1 = t2MOVi 3, 14, $noreg, $noreg
$r2 = t2MOVi 3, 14, $noreg, $noreg
$r3 = t2MOVi 3, 14, $noreg, $noreg
bb.2:
liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r0 = t2LDRi12 $sp, 0, 14, $noreg
$r1 = t2MOVi 3, 14, $noreg, $noreg
$r2 = t2MOVi 3, 14, $noreg, $noreg
$r3 = t2MOVi 3, 14, $noreg, $noreg
bb.3:
liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
$r2 = tMOVr $lr, 14, $noreg
tBX_RET 14, $noreg
; CHECK-LABEL: name: OUTLINED_FUNCTION_0
; CHECK: bb.0:
; CHECK: liveins: $lr, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r0 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r4 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r5 = MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: MOVPCLR 14 /* CC::al */, $noreg
; CHECK-LABEL: name: OUTLINED_FUNCTION_1
; CHECK: bb.0:
; CHECK: liveins: $lr, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11
; CHECK: $r0 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r1 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r2 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: $r3 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
; CHECK: tBX_RET 14 /* CC::al */, $noreg