[ARM] GlobalISel: Add mapping for G_CONSTANT

Like G_FRAME_INDEX, G_CONSTANT has one register operand and one non-register
operand.

llvm-svn: 296469
This commit is contained in:
Diana Picus 2017-02-28 12:13:58 +00:00
parent e6beac6742
commit 5b8514559e
2 changed files with 19 additions and 0 deletions

View File

@ -240,6 +240,7 @@ ARMRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
? &ARM::ValueMappings[ARM::DPR3OpsIdx]
: &ARM::ValueMappings[ARM::SPR3OpsIdx];
break;
case G_CONSTANT:
case G_FRAME_INDEX:
OperandsMapping =
getOperandsMapping({&ARM::ValueMappings[ARM::GPR3OpsIdx], nullptr});

View File

@ -10,6 +10,8 @@
define void @test_gep() { ret void }
define void @test_constants() { ret void }
define void @test_fadd_s32() #0 { ret void }
define void @test_fadd_s64() #0 { ret void }
@ -225,6 +227,22 @@ body: |
BX_RET 14, _, implicit %r0
...
---
name: test_constants
# CHECK-LABEL: name: test_constants
legalized: true
regBankSelected: false
selected: false
# CHECK: registers:
# CHECK: - { id: 0, class: gprb }
registers:
- { id: 0, class: _ }
body: |
bb.0:
%0(s32) = G_CONSTANT 42
%r0 = COPY %0(s32)
BX_RET 14, _, implicit %r0
...
---
name: test_fadd_s32
# CHECK-LABEL: name: test_fadd_s32
legalized: true