1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[ARM] GlobalISel: Add reg bank mappings for stores

Same as the ones for loads.

llvm-svn: 296115
This commit is contained in:
Diana Picus 2017-02-24 13:07:25 +00:00
parent c1be876d60
commit 003ac86cc4
2 changed files with 45 additions and 0 deletions

View File

@ -181,6 +181,7 @@ const RegisterBank &ARMRegisterBankInfo::getRegBankFromRegClass(
case GPRRegClassID: case GPRRegClassID:
case GPRnopcRegClassID: case GPRnopcRegClassID:
case tGPR_and_tcGPRRegClassID: case tGPR_and_tcGPRRegClassID:
case tGPRRegClassID:
return getRegBank(ARM::GPRRegBankID); return getRegBank(ARM::GPRRegBankID);
case SPR_8RegClassID: case SPR_8RegClassID:
case SPRRegClassID: case SPRRegClassID:
@ -224,6 +225,7 @@ ARMRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
OperandsMapping = &ARM::ValueMappings[ARM::GPR3OpsIdx]; OperandsMapping = &ARM::ValueMappings[ARM::GPR3OpsIdx];
break; break;
case G_LOAD: case G_LOAD:
case G_STORE:
OperandsMapping = OperandsMapping =
Ty.getSizeInBits() == 64 Ty.getSizeInBits() == 64
? getOperandsMapping({&ARM::ValueMappings[ARM::DPR3OpsIdx], ? getOperandsMapping({&ARM::ValueMappings[ARM::DPR3OpsIdx],

View File

@ -6,6 +6,7 @@
define void @test_add_s1() { ret void } define void @test_add_s1() { ret void }
define void @test_loads() #0 { ret void } define void @test_loads() #0 { ret void }
define void @test_stores() #0 { ret void }
define void @test_fadd_s32() #0 { ret void } define void @test_fadd_s32() #0 { ret void }
define void @test_fadd_s64() #0 { ret void } define void @test_fadd_s64() #0 { ret void }
@ -153,6 +154,48 @@ body: |
%5(p0) = G_LOAD %0 :: (load 8) %5(p0) = G_LOAD %0 :: (load 8)
BX_RET 14, _, implicit %r0 BX_RET 14, _, implicit %r0
...
---
name: test_stores
# CHECK-LABEL: name: test_stores
legalized: true
regBankSelected: false
selected: false
# CHECK: registers:
# CHECK: - { id: 0, class: gprb }
# CHECK: - { id: 1, class: gprb }
# CHECK: - { id: 2, class: gprb }
# CHECK: - { id: 3, class: gprb }
# CHECK: - { id: 4, class: gprb }
# CHECK: - { id: 5, class: gprb }
# CHECK: - { id: 6, class: fprb }
registers:
- { id: 0, class: _ }
- { id: 1, class: _ }
- { id: 2, class: _ }
- { id: 3, class: _ }
- { id: 4, class: _ }
- { id: 5, class: _ }
- { id: 6, class: _ }
body: |
bb.0:
liveins: %r0, %r1, %r2, %r3, %r4, %r5, %d6
%0(p0) = COPY %r0
%1(s32) = COPY %r1
G_STORE %1(s32), %0 :: (store 4)
%2(s16) = COPY %r2
G_STORE %2(s16), %0 :: (store 2)
%3(s8) = COPY %r3
G_STORE %3(s8), %0 :: (store 1)
%4(s1) = COPY %r4
G_STORE %4(s1), %0 :: (store 1)
%5(p0) = COPY %r5
G_STORE %5(p0), %0 :: (store 8)
%6(s64) = COPY %d6
G_STORE %6(s64), %0 :: (store 8)
BX_RET 14, _, implicit %r0
... ...
--- ---
name: test_fadd_s32 name: test_fadd_s32