1 # RUN: llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s
2 # This test ensures that the MIR parser parses the callee saved register mask
3 # correctly and that the MIR parser can infer it as well.
7 define i32 @compute(i32 %a) #0 {
13 define i32 @foo(i32 %a) #0 {
15 %b = call i32 @compute(i32 %a)
19 define i32 @bar(i32 %a) #0 {
21 %b = call i32 @compute(i32 %a)
25 define i32 @empty(i32 %a) #0 {
27 %b = call i32 @compute(i32 %a)
31 attributes #0 = { "no-frame-pointer-elim"="false" }
35 # CHECK: name: compute
37 # CHECK-NEXT: - { reg: '%edi' }
38 # CHECK-NEXT: frameInfo:
49 - '%eax = IMUL32rri8 %edi, 11, implicit-def %eflags'
57 # CHECK: calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
58 # CHECK-NEXT: '%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
59 # CHECK-NEXT: '%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
60 # CHECK-NEXT: '%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
61 calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
62 '%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
63 '%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
64 '%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
70 - 'PUSH64r %rax, implicit-def %rsp, implicit %rsp'
71 - 'CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax'
72 - '%rdx = POP64r implicit-def %rsp, implicit %rsp'
79 # Verify that the callee saved register can be inferred from register mask
82 # CHECK: calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
83 # CHECK-NEXT: '%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
84 # CHECK-NEXT: '%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
85 # CHECK-NEXT: '%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
91 - 'PUSH64r %rax, implicit-def %rsp, implicit %rsp'
92 - 'CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax'
93 - '%rdx = POP64r implicit-def %rsp, implicit %rsp'
100 # Verify that the callee saved register can be empty.
102 # CHECK: calleeSavedRegisters: [ ]
103 calleeSavedRegisters: [ ]
109 - 'PUSH64r %rax, implicit-def %rsp, implicit %rsp'
110 - 'CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax'
111 - '%rdx = POP64r implicit-def %rsp, implicit %rsp'