xref: /llvm-project/llvm/test/CodeGen/Thumb/high-reg-clobber.mir (revision 1bc8b3258e6d42f702fb11eb60d84d0e23935e3e)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple thumbv6m-arm-none-eabi -run-pass regallocbasic %s -o - | FileCheck %s
3# RUN: llc -mtriple thumbv6m-arm-none-eabi -run-pass greedy %s -o - | FileCheck %s
4# RUN: llc -mtriple thumbv6m-arm-none-eabi -run-pass regallocfast %s -o - | FileCheck %s --check-prefix=FAST
5# RUN: llc -mtriple thumbv6m-arm-none-eabi -passes=regallocfast %s -o - | FileCheck %s --check-prefix=FAST
6
7...
8---
9name:            constraint_h
10alignment:       2
11tracksRegLiveness: true
12registers:
13  - { id: 0, class: tgpr }
14  - { id: 1, class: hgpr }
15  - { id: 2, class: tgpr }
16liveins:
17  - { reg: '$r0', virtual-reg: '%0' }
18frameInfo:
19  maxAlignment:    4
20  maxCallFrameSize: 0
21  localFrameSize:  4
22stack:
23  - { id: 0, size: 4, alignment: 4, local-offset: -4 }
24machineFunctionInfo: {}
25body:             |
26  bb.0.entry:
27    liveins: $r0
28
29    ; CHECK-LABEL: name: constraint_h
30    ; CHECK: liveins: $r0
31    ; CHECK: [[COPY:%[0-9]+]]:tgpr = COPY $r0
32    ; CHECK: tSTRspi [[COPY]], %stack.0, 0, 14 /* CC::al */, $noreg
33    ; CHECK: [[tLDRspi:%[0-9]+]]:tgpr = tLDRspi %stack.0, 0, 14 /* CC::al */, $noreg
34    ; CHECK: [[COPY1:%[0-9]+]]:hgpr = COPY [[tLDRspi]]
35    ; CHECK: INLINEASM &"mov r12, $0", 1 /* sideeffect attdialect */, 1048585 /* reguse:GPRnoip_and_GPRnopc */, %1, 12 /* clobber */, implicit-def early-clobber $r12
36    ; CHECK: tBX_RET 14 /* CC::al */, $noreg
37    ; FAST-LABEL: name: constraint_h
38    ; FAST: liveins: $r0
39    ; FAST: tSTRspi killed renamable $r0, %stack.0, 0, 14 /* CC::al */, $noreg
40    ; FAST: renamable $r0 = tLDRspi %stack.0, 0, 14 /* CC::al */, $noreg
41    ; FAST: renamable $r8 = COPY killed renamable $r0
42    ; FAST: INLINEASM &"mov r12, $0", 1 /* sideeffect attdialect */, 1048585 /* reguse:GPRnoip_and_GPRnopc */, killed renamable $r8, 12 /* clobber */, implicit-def dead early-clobber $r12
43    ; FAST: tBX_RET 14 /* CC::al */, $noreg
44    %0:tgpr = COPY $r0
45    tSTRspi %0, %stack.0, 0, 14 /* CC::al */, $noreg
46    %2:tgpr = tLDRspi %stack.0, 0, 14 /* CC::al */, $noreg
47    %1:hgpr = COPY %2
48    INLINEASM &"mov r12, $0", 1 /* sideeffect attdialect */, 1048585 /* reguse:hGPR */, %1, 12 /* clobber */, implicit-def early-clobber $r12
49    tBX_RET 14 /* CC::al */, $noreg
50
51...
52