mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
178bc607c9
This patch handles cases where we have to save/restore the link register into the stack and and load/store instruction which use the stack are part of the outlined region. It checks that there will be no overflow introduced by the new offset and fixup these instructions accordingly. Differential Revision: https://reviews.llvm.org/D92934
137 lines
5.2 KiB
YAML
137 lines
5.2 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 }
|
|
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
|
|
|
|
; 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
|
|
|
|
|
|
|