1 # RUN: llc -o - %s -mtriple=aarch64-windows -start-before=prologepilog \
2 # RUN: -stop-after=prologepilog | FileCheck %s
3 # Test that the frame lowering emits correct SEH updates for the case without
4 # a stack frame (e.g. no callee saved registers, no frame pointer, just locals)
6 # CHECK: $sp = frame-setup SUBXri $sp, 16, 0
7 # CHECK-NEXT: frame-setup SEH_StackAlloc 16
8 # CHECK-NEXT: frame-setup SEH_PrologEnd
9 # CHECK: frame-destroy SEH_EpilogStart
10 # CHECK-NEXT: $sp = frame-destroy ADDXri $sp, 16, 0
11 # CHECK-NEXT: frame-destroy SEH_StackAlloc 16
12 # CHECK-NEXT: frame-destroy SEH_EpilogEnd
13 # CHECK-NEXT: RET_ReallyLR implicit killed $w0
16 target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
17 target triple = "aarch64-unknown-windows-msvc19.11.0"
19 ; Function Attrs: noinline nounwind optnone uwtable
20 define dso_local i32 @"?func@@YAHH@Z"(i32 %a) #0 {
22 %a.addr = alloca i32, align 4
23 %b = alloca i32, align 4
24 store i32 %a, i32* %a.addr, align 4
25 store i32 2, i32* %b, align 4
26 %0 = load i32, i32* %b, align 4
27 %1 = load i32, i32* %a.addr, align 4
28 %add = add nsw i32 %0, %1
32 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" "unsafe-fp-math"="false" "use-soft-float"="false" }
38 exposesReturnsTwice: false
43 tracksRegLiveness: true
47 isFrameAddressTaken: false
48 isReturnAddressTaken: false
58 cvBytesOfCalleeSavedRegisters: 0
59 hasOpaqueSPAdjustment: false
61 hasMustTailInVarArgFunc: false
67 - { id: 0, name: a.addr, type: default, offset: 0, size: 4, alignment: 4,
68 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
69 local-offset: -4, debug-info-variable: '', debug-info-expression: '',
70 debug-info-location: '' }
71 - { id: 1, name: b, type: default, offset: 0, size: 4, alignment: 4,
72 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
73 local-offset: -8, debug-info-variable: '', debug-info-expression: '',
74 debug-info-location: '' }
80 renamable $w8 = MOVi32imm 2
81 STRWui killed renamable $w0, %stack.0.a.addr, 0 :: (store (s32) into %ir.a.addr)
82 STRWui killed renamable $w8, %stack.1.b, 0 :: (store (s32) into %ir.b)
83 renamable $w8 = LDRWui %stack.1.b, 0 :: (load (s32) from %ir.b)
84 renamable $w0 = LDRWui %stack.0.a.addr, 0 :: (load (s32) from %ir.a.addr)
85 renamable $w0 = nsw ADDWrr killed renamable $w8, killed renamable $w0
86 RET_ReallyLR implicit killed $w0