92 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=riscv64 -run-pass=prologepilog -simplify-mir -o - %s | FileCheck %s3# verify live-on-entry registers are not marked killed by spills4--- |5 6 declare void @vararg(i32 signext, ...)7 8 define void @test1() {9 entry:10 %a = alloca i32, align 411 %0 = call ptr @llvm.returnaddress(i32 0)12 %1 = ptrtoint ptr %0 to i6413 %conv = trunc i64 %1 to i3214 store i32 %conv, ptr %a, align 415 %2 = load i32, ptr %a, align 416 call void (i32, ...) @vararg(i32 signext 0, i32 signext %2)17 ret void18 }19 20...21---22name: test123alignment: 424exposesReturnsTwice: false25legalized: false26regBankSelected: false27selected: false28failedISel: false29tracksRegLiveness: true30hasWinCFI: false31registers: []32liveins:33 - { reg: '$x1', virtual-reg: '' }34frameInfo:35 isFrameAddressTaken: false36 isReturnAddressTaken: true37 hasStackMap: false38 hasPatchPoint: false39 stackSize: 040 offsetAdjustment: 041 maxAlignment: 442 adjustsStack: true43 hasCalls: true44 stackProtector: ''45 maxCallFrameSize: 429496729546 cvBytesOfCalleeSavedRegisters: 047 hasOpaqueSPAdjustment: false48 hasVAStart: false49 hasMustTailInVarArgFunc: false50 hasTailCall: false51 localFrameSize: 052 savePoint: []53 restorePoint: []54fixedStack: []55stack:56 - { id: 0, name: a, type: default, offset: 0, size: 4, alignment: 4,57 stack-id: default, callee-saved-register: '', callee-saved-restored: true,58 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }59callSites: []60debugValueSubstitutions: []61constants: []62machineFunctionInfo: {}63body: |64 bb.0.entry:65 liveins: $x166 67 ; CHECK-LABEL: name: test168 ; CHECK: liveins: $x169 ; CHECK-NEXT: {{ $}}70 ; CHECK-NEXT: $x2 = frame-setup ADDI $x2, -1671 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 1672 ; CHECK-NEXT: frame-setup SD $x1, $x2, 8 :: (store (s64) into %stack.1)73 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -874 ; CHECK-NEXT: SW renamable $x1, $x2, 4 :: (store (s32) into %ir.a)75 ; CHECK-NEXT: renamable $x11 = ADDIW killed renamable $x1, 076 ; CHECK-NEXT: $x10 = COPY $x077 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) @vararg, csr_ilp32_lp64, implicit-def dead $x1, implicit killed $x10, implicit $x11, implicit-def $x278 ; CHECK-NEXT: $x1 = frame-destroy LD $x2, 8 :: (load (s64) from %stack.1)79 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $x180 ; CHECK-NEXT: $x2 = frame-destroy ADDI $x2, 1681 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 082 ; CHECK-NEXT: PseudoRET83 SW renamable $x1, %stack.0.a, 0 :: (store (s32) into %ir.a)84 renamable $x11 = ADDIW killed renamable $x1, 085 ADJCALLSTACKDOWN 0, 0, implicit-def dead $x2, implicit $x286 $x10 = COPY $x087 PseudoCALL target-flags(riscv-call) @vararg, csr_ilp32_lp64, implicit-def dead $x1, implicit killed $x10, implicit $x11, implicit-def $x288 ADJCALLSTACKUP 0, 0, implicit-def dead $x2, implicit $x289 PseudoRET90 91...92