1 # RUN: llc -march=x86-64 -start-after prologepilog -stop-after prologepilog -o /dev/null %s | FileCheck %s
2 # This test ensures that the MIR parser parses callee saved information in the
3 # stack objects correctly.
7 define i32 @compute(i32 %a) {
12 define i32 @func(i32 %a) {
19 %comp = icmp sle i32 %a, 10
20 br i1 %comp, label %loop, label %exit
23 %c = load i32, i32* %b
24 %d = call i32 @compute(i32 %c)
36 tracksRegLiveness: true
41 %eax = COPY killed %edi
46 tracksRegLiveness: true
53 # CHECK-NEXT: , callee-saved-register: '%rbx' }
55 - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '%rbx' }
57 # CHECK-NEXT: - { id: 0
58 # CHECK-NEXT: , callee-saved-register: '%edi' }
60 - { id: 0, name: b, offset: -20, size: 4, alignment: 4 }
61 - { id: 1, offset: -24, size: 4, alignment: 4, callee-saved-register: '%edi' }
64 successors: %bb.1.check
67 frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
68 %rsp = frame-setup SUB64ri8 %rsp, 16, implicit-def dead %eflags
70 MOV32mr %rsp, 1, _, 12, _, %ebx
73 successors: %bb.2.loop, %bb.3.exit
76 CMP32ri8 %ebx, 10, implicit-def %eflags
77 JG_1 %bb.3.exit, implicit killed %eflags
81 successors: %bb.1.check
84 %edi = MOV32rm %rsp, 1, _, 12, _
85 CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax
86 %eax = DEC32r killed %eax, implicit-def dead %eflags
87 MOV32mr %rsp, 1, _, 12, _, killed %eax
91 %eax = MOV32r0 implicit-def dead %eflags
92 %rsp = ADD64ri8 %rsp, 16, implicit-def dead %eflags
93 %rbx = POP64r implicit-def %rsp, implicit %rsp