[llvm] r296115 - [ARM] GlobalISel: Add reg bank mappings for stores
Diana Picus via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 24 05:07:25 PST 2017
Author: rovka
Date: Fri Feb 24 07:07:25 2017
New Revision: 296115
URL: http://llvm.org/viewvc/llvm-project?rev=296115&view=rev
Log:
[ARM] GlobalISel: Add reg bank mappings for stores
Same as the ones for loads.
Modified:
llvm/trunk/lib/Target/ARM/ARMRegisterBankInfo.cpp
llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir
Modified: llvm/trunk/lib/Target/ARM/ARMRegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterBankInfo.cpp?rev=296115&r1=296114&r2=296115&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMRegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMRegisterBankInfo.cpp Fri Feb 24 07:07:25 2017
@@ -181,6 +181,7 @@ const RegisterBank &ARMRegisterBankInfo:
case GPRRegClassID:
case GPRnopcRegClassID:
case tGPR_and_tcGPRRegClassID:
+ case tGPRRegClassID:
return getRegBank(ARM::GPRRegBankID);
case SPR_8RegClassID:
case SPRRegClassID:
@@ -224,6 +225,7 @@ ARMRegisterBankInfo::getInstrMapping(con
OperandsMapping = &ARM::ValueMappings[ARM::GPR3OpsIdx];
break;
case G_LOAD:
+ case G_STORE:
OperandsMapping =
Ty.getSizeInBits() == 64
? getOperandsMapping({&ARM::ValueMappings[ARM::DPR3OpsIdx],
Modified: llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir?rev=296115&r1=296114&r2=296115&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir (original)
+++ llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir Fri Feb 24 07:07:25 2017
@@ -6,6 +6,7 @@
define void @test_add_s1() { 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_s64() #0 { ret void }
@@ -154,6 +155,48 @@ body: |
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
# CHECK-LABEL: name: test_fadd_s32
More information about the llvm-commits
mailing list