1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 define void @test_s8() { ret void }
5 define void @test_s16() { ret void }
6 define void @test_s32() { ret void }
8 define void @test_gep() { ret void }
10 define void @test_load_from_stack() { ret void }
18 - { id: 0, class: gprb }
19 - { id: 1, class: gprb }
24 ; CHECK-LABEL: name: test_s8
25 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
26 ; CHECK: [[t2LDRBi12_:%[0-9]+]]:rgpr = t2LDRBi12 [[COPY]], 0, 14 /* CC::al */, $noreg :: (load (s8))
27 ; CHECK: t2STRBi12 [[t2LDRBi12_]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
28 ; CHECK: BX_RET 14 /* CC::al */, $noreg
31 %1(s8) = G_LOAD %0(p0) :: (load (s8))
33 G_STORE %1(s8), %0(p0) :: (store (s8))
43 - { id: 0, class: gprb }
44 - { id: 1, class: gprb }
49 ; CHECK-LABEL: name: test_s16
50 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
51 ; CHECK: [[t2LDRHi12_:%[0-9]+]]:rgpr = t2LDRHi12 [[COPY]], 0, 14 /* CC::al */, $noreg :: (load (s16))
52 ; CHECK: t2STRHi12 [[t2LDRHi12_]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s16))
53 ; CHECK: BX_RET 14 /* CC::al */, $noreg
56 %1(s16) = G_LOAD %0(p0) :: (load (s16))
58 G_STORE %1(s16), %0(p0) :: (store (s16))
68 - { id: 0, class: gprb }
69 - { id: 1, class: gprb }
74 ; CHECK-LABEL: name: test_s32
75 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
76 ; CHECK: [[t2LDRi12_:%[0-9]+]]:gpr = t2LDRi12 [[COPY]], 0, 14 /* CC::al */, $noreg :: (load (s32))
77 ; CHECK: t2STRi12 [[t2LDRi12_]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s32))
78 ; CHECK: BX_RET 14 /* CC::al */, $noreg
81 %1(s32) = G_LOAD %0(p0) :: (load (s32))
83 G_STORE %1(s32), %0(p0) :: (store (s32))
93 - { id: 0, class: gprb }
94 - { id: 1, class: gprb }
95 - { id: 2, class: gprb }
100 ; CHECK-LABEL: name: test_gep
101 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
102 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
103 ; CHECK: [[t2ADDrr:%[0-9]+]]:gprnopc = t2ADDrr [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
104 ; CHECK: $r0 = COPY [[t2ADDrr]]
105 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
110 %2(p0) = G_PTR_ADD %0, %1(s32)
114 BX_RET 14, $noreg, implicit $r0
117 name: test_load_from_stack
119 regBankSelected: true
122 - { id: 0, class: gprb }
123 - { id: 1, class: gprb }
124 - { id: 2, class: gprb }
125 - { id: 3, class: gprb }
126 - { id: 4, class: gprb }
128 - { id: 0, offset: 0, size: 1, alignment: 4, isImmutable: true, isAliased: false }
129 - { id: 1, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
130 - { id: 2, offset: 8, size: 4, alignment: 4, isImmutable: true, isAliased: false }
133 liveins: $r0, $r1, $r2, $r3
135 ; CHECK-LABEL: name: test_load_from_stack
136 ; CHECK: [[t2ADDri:%[0-9]+]]:rgpr = t2ADDri %fixed-stack.0, 0, 14 /* CC::al */, $noreg, $noreg
137 ; CHECK: [[t2LDRi12_:%[0-9]+]]:gpr = t2LDRi12 [[t2ADDri]], 0, 14 /* CC::al */, $noreg :: (load (s32))
138 ; CHECK: $r0 = COPY [[t2LDRi12_]]
139 ; CHECK: [[t2ADDri1:%[0-9]+]]:rgpr = t2ADDri %fixed-stack.2, 0, 14 /* CC::al */, $noreg, $noreg
140 ; CHECK: [[t2LDRBi12_:%[0-9]+]]:gprnopc = t2LDRBi12 [[t2ADDri1]], 0, 14 /* CC::al */, $noreg :: (load (s8))
141 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY [[t2LDRBi12_]]
142 ; CHECK: $r0 = COPY [[COPY]]
143 ; CHECK: BX_RET 14 /* CC::al */, $noreg
144 %0(p0) = G_FRAME_INDEX %fixed-stack.2
146 %1(s32) = G_LOAD %0(p0) :: (load (s32))
150 %2(p0) = G_FRAME_INDEX %fixed-stack.0
152 %3(s8) = G_LOAD %2(p0) :: (load (s8))
154 %4(s32) = G_ANYEXT %3(s8)