1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir
Matt Arsenault cc12b285b6 CodeGen: Print/parse LLTs in MachineMemOperands
This will currently accept the old number of bytes syntax, and convert
it to a scalar. This should be removed in the near future (I think I
converted all of the tests already, but likely missed a few).

Not sure what the exact syntax and policy should be. We can continue
printing the number of bytes for non-generic instructions to avoid
test churn and only allow non-scalar types for generic instructions.

This will currently print the LLT in parentheses, but accept parsing
the existing integers and implicitly converting to scalar. The
parentheses are a bit ugly, but the parser logic seems unable to deal
without either parentheses or some keyword to indicate the start of a
type.
2021-06-30 16:54:13 -04:00

207 lines
10 KiB
YAML

# RUN: llc -verify-machineinstrs -run-pass=machine-outliner %s -o - | FileCheck %s
--- |
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-arm-linux-gnu"
@v = common dso_local global i32* null, align 8
; Function Attrs: nounwind
define dso_local void @legal0() #0 {
%1 = alloca i32, align 4
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
ret void
}
; Function Attrs: nounwind
define dso_local void @legal1() #0 {
%1 = alloca i32, align 4
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
ret void
}
; Function Attrs: nounwind
define dso_local void @illegal0() #0 {
%1 = alloca i32, align 4
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
ret void
}
; Function Attrs: nounwind
define dso_local void @illegal1() #0 {
%1 = alloca i32, align 4
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
store volatile i32* %1, i32** @v, align 8
ret void
}
attributes #0 = { nounwind "sign-return-address"="all" "sign-return-address-key"="a_key" noinline noredzone "frame-pointer"="all" }
...
---
name: legal0
tracksRegLiveness: true
body: |
bb.0 (%ir-block.0):
liveins: $lr
frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
frame-setup CFI_INSTRUCTION negate_ra_sign_state
$sp = frame-setup SUBXri $sp, 16, 0
renamable $x8 = ADRP target-flags(aarch64-page) @v
$x9 = ADDXri $sp, 12, 0
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
$sp = frame-destroy ADDXri $sp, 16, 0
frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
RET undef $lr
# CHECK-LABEL: name: legal0
# CHECK: body: |
# CHECK-NEXT: bb.0 (%ir-block.0):
# CHECK-NEXT: liveins: $lr
# CHECK: frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
# CHECK: BL @[[OUTLINED_FUNC:OUTLINED_FUNCTION_[0-9]+]]
# CHECK: frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: RET undef $lr
...
---
name: legal1
tracksRegLiveness: true
body: |
bb.0 (%ir-block.0):
liveins: $lr
frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
frame-setup CFI_INSTRUCTION negate_ra_sign_state
$sp = frame-setup SUBXri $sp, 16, 0
renamable $x8 = ADRP target-flags(aarch64-page) @v
$x9 = ADDXri $sp, 12, 0
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
$sp = frame-destroy ADDXri $sp, 16, 0
frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
RET undef $lr
# CHECK-LABEL: name: legal1
# CHECK: body: |
# CHECK-NEXT: bb.0 (%ir-block.0):
# CHECK-NEXT: liveins: $lr
# CHECK: frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
# CHECK: BL @[[OUTLINED_FUNC]]
# CHECK: frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: RET undef $lr
...
---
name: illegal0
tracksRegLiveness: true
body: |
bb.0 (%ir-block.0):
liveins: $lr
frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
frame-setup CFI_INSTRUCTION negate_ra_sign_state
$sp = frame-setup SUBXri $sp, 16, 0
renamable $x8 = ADRP target-flags(aarch64-page) @v
$x9 = ADDXri $sp, 12, 0
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
$sp = frame-destroy ADDXri $sp, 12, 0
frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
RET undef $lr
...
---
name: illegal1
tracksRegLiveness: true
body: |
bb.0 (%ir-block.0):
liveins: $lr
frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
frame-setup CFI_INSTRUCTION negate_ra_sign_state
$sp = frame-setup SUBXri $sp, 16, 0
renamable $x8 = ADRP target-flags(aarch64-page) @v
$x9 = ADDXri $sp, 12, 0
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
$sp = frame-destroy ADDXri $sp, 12, 0
frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
RET undef $lr
# CHECK-LABEL: name: illegal0
# CHECK: body: |
# CHECK-NEXT: bb.0 (%ir-block.0):
# CHECK-NEXT: liveins: $lr
# CHECK: frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
# CHECK-NOT: BL @OUTLINED_FUNCTION_{{.*}}
# CHECK: frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: RET undef $lr
# CHECK-LABEL: name: illegal1
# CHECK: body: |
# CHECK-NEXT: bb.0 (%ir-block.0):
# CHECK-NEXT: liveins: $lr
# CHECK: frame-setup PACIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
# CHECK-NOT: BL @OUTLINED_FUNCTION_{{.*}}
# CHECK: frame-destroy AUTIASP implicit-def $lr, implicit killed $lr, implicit $sp
# CHECK-NEXT: RET undef $lr
# Outlined function that contains only legal sp modifications
# CHECK: name: [[OUTLINED_FUNC]]
# CHECK: body: |
# CHECK-NEXT: bb.0:
# CHECK-NEXT: liveins: $lr
# CHECK-NEXT: {{^ $}}
# CHECK-NEXT: frame-setup PACIASP implicit-def $lr, implicit $lr, implicit $sp
# CHECK-NEXT: frame-setup CFI_INSTRUCTION negate_ra_sign_state
# CHECK-NEXT: $sp = frame-setup SUBXri $sp, 16, 0
# CHECK: $sp = frame-destroy ADDXri $sp, 16, 0
# CHECK-NEXT: frame-destroy AUTIASP implicit-def $lr, implicit $lr, implicit $sp
# CHECK-NEXT: RET $lr