150 lines · plain
1# RUN: llc -o - %s -mtriple=aarch64-windows -start-before=prologepilog \2# RUN: -stop-after=prologepilog | FileCheck %s3# Test that stack probe results in Nop unwind codes in the prologue. Test4# save_fplr, save_reg_x and stack_alloc with multiple updates5 6# CHECK: early-clobber $sp = frame-setup STPXpre killed $fp, killed $lr, $sp, -27# CHECK-NEXT: frame-setup SEH_SaveFPLR_X -168# CHECK-NEXT: $fp = frame-setup ADDXri $sp, 0, 09# CHECK-NEXT: frame-setup SEH_SetFP10# CHECK-NEXT: frame-setup SEH_PrologEnd11# CHECK-NEXT: $sp = frame-setup SUBXri $sp, 32, 012# CHECK: frame-destroy SEH_EpilogStart13# CHECK-NEXT: $sp = frame-destroy ADDXri $fp, 0, 014# CHECK-NEXT: frame-destroy SEH_SetFP15# CHECK-NEXT: early-clobber $sp, $fp, $lr = frame-destroy LDPXpost $sp, 216# CHECK-NEXT: frame-destroy SEH_SaveFPLR_X -1617# CHECK-NEXT: frame-destroy SEH_EpilogEnd18# CHECK-NEXT: RET_ReallyLR implicit killed $w019--- |20 target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"21 target triple = "aarch64-unknown-windows-msvc19.11.0"22 23 ; Function Attrs: noinline optnone24 define dso_local i32 @"?func@@YAHHHHH@Z"(i32 %n, i32 %idx, i32 %b, i32 %c) #0 {25 entry:26 %c.addr = alloca i32, align 427 %b.addr = alloca i32, align 428 %idx.addr = alloca i32, align 429 %n.addr = alloca i32, align 430 %a = alloca ptr, align 831 store i32 %c, ptr %c.addr, align 432 store i32 %b, ptr %b.addr, align 433 store i32 %idx, ptr %idx.addr, align 434 store i32 %n, ptr %n.addr, align 435 %0 = load i32, ptr %n.addr, align 436 %conv = sext i32 %0 to i6437 %1 = alloca i8, i64 %conv, align 1638 %2 = bitcast ptr %1 to ptr39 store ptr %2, ptr %a, align 840 %3 = load ptr, ptr %a, align 841 call void @"?init@@YAXPEAH@Z"(ptr %3)42 ret i32 043 }44 45 declare dso_local void @"?init@@YAXPEAH@Z"(ptr) #146 47 ; Function Attrs: nounwind48 declare void @llvm.stackprotector(ptr, ptr) #249 50 attributes #0 = { noinline optnone "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" "use-soft-float"="false" }51 attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="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" "use-soft-float"="false" }52 attributes #2 = { nounwind }53 54...55---56name: '?func@@YAHHHHH@Z'57alignment: 458exposesReturnsTwice: false59legalized: false60regBankSelected: false61selected: false62failedISel: false63tracksRegLiveness: true64hasWinCFI: false65registers:66liveins:67 - { reg: '$w0', virtual-reg: '' }68 - { reg: '$w1', virtual-reg: '' }69 - { reg: '$w2', virtual-reg: '' }70 - { reg: '$w3', virtual-reg: '' }71frameInfo:72 isFrameAddressTaken: false73 isReturnAddressTaken: false74 hasStackMap: false75 hasPatchPoint: false76 stackSize: 077 offsetAdjustment: 078 maxAlignment: 879 adjustsStack: true80 hasCalls: true81 stackProtector: ''82 maxCallFrameSize: 083 cvBytesOfCalleeSavedRegisters: 084 hasOpaqueSPAdjustment: false85 hasVAStart: false86 hasMustTailInVarArgFunc: false87 localFrameSize: 2488 savePoint: []89 restorePoint: []90fixedStack:91stack:92 - { id: 0, name: c.addr, type: default, offset: 0, size: 4, alignment: 4,93 stack-id: default, callee-saved-register: '', callee-saved-restored: true,94 local-offset: -4, debug-info-variable: '', debug-info-expression: '',95 debug-info-location: '' }96 - { id: 1, name: b.addr, type: default, offset: 0, size: 4, alignment: 4,97 stack-id: default, callee-saved-register: '', callee-saved-restored: true,98 local-offset: -8, debug-info-variable: '', debug-info-expression: '',99 debug-info-location: '' }100 - { id: 2, name: idx.addr, type: default, offset: 0, size: 4, alignment: 4,101 stack-id: default, callee-saved-register: '', callee-saved-restored: true,102 local-offset: -12, debug-info-variable: '', debug-info-expression: '',103 debug-info-location: '' }104 - { id: 3, name: n.addr, type: default, offset: 0, size: 4, alignment: 4,105 stack-id: default, callee-saved-register: '', callee-saved-restored: true,106 local-offset: -16, debug-info-variable: '', debug-info-expression: '',107 debug-info-location: '' }108 - { id: 4, name: a, type: default, offset: 0, size: 8, alignment: 8,109 stack-id: default, callee-saved-register: '', callee-saved-restored: true,110 local-offset: -24, debug-info-variable: '', debug-info-expression: '',111 debug-info-location: '' }112 - { id: 5, name: '', type: variable-sized, offset: 0,113 alignment: 1, stack-id: default, callee-saved-register: '', callee-saved-restored: true,114 local-offset: -24, debug-info-variable: '', debug-info-expression: '',115 debug-info-location: '' }116 - { id: 6, name: '', type: spill-slot, offset: 0, size: 8, alignment: 8,117 stack-id: default, callee-saved-register: '', callee-saved-restored: true,118 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }119constants:120body: |121 bb.0.entry:122 liveins: $w0, $w1, $w2, $w3123 124 STRWui killed renamable $w3, %stack.0.c.addr, 0 :: (store (s32) into %ir.c.addr)125 STRWui killed renamable $w2, %stack.1.b.addr, 0 :: (store (s32) into %ir.b.addr)126 STRWui killed renamable $w1, %stack.2.idx.addr, 0 :: (store (s32) into %ir.idx.addr)127 STRWui killed renamable $w0, %stack.3.n.addr, 0 :: (store (s32) into %ir.n.addr)128 renamable $x8 = LDRSWui %stack.3.n.addr, 0 :: (dereferenceable load (s32) from %ir.n.addr)129 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp130 renamable $x8 = nuw ADDXri killed renamable $x8, 15, 0131 renamable $x8 = UBFMXri killed renamable $x8, 4, 63132 $x15 = COPY renamable $x8133 STRXui killed $x8, %stack.6, 0 :: (store (s64) into %stack.6)134 BL &__chkstk, csr_aarch64_stackprobe_windows, implicit-def dead $lr, implicit $sp, implicit killed $x15135 renamable $x8 = COPY $sp136 $x15 = LDRXui %stack.6, 0 :: (load (s64) from %stack.6)137 renamable $x8 = SUBSXrs killed renamable $x8, killed renamable $x15, 4, implicit-def dead $nzcv138 $sp = COPY renamable $x8139 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp140 STRXui killed renamable $x8, %stack.4.a, 0 :: (store (s64) into %ir.a)141 renamable $x0 = LDRXui %stack.4.a, 0 :: (dereferenceable load (s64) from %ir.a)142 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp143 BL @"?init@@YAXPEAH@Z", csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp144 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp145 renamable $w1 = COPY $wzr146 $w0 = COPY killed renamable $w1147 RET_ReallyLR implicit killed $w0148 149...150