[ARM GlobalISel] Widen G_GEP index operand

llvm-svn: 360127
This commit is contained in:
Diana Picus
2019-05-07 10:11:57 +00:00
parent 3f585ae3ce
commit d18bac5d19
2 changed files with 34 additions and 4 deletions

View File

@@ -146,7 +146,9 @@ ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
.legalFor({s32, p0})
.minScalar(0, s32);
getActionDefinitionsBuilder(G_GEP).legalFor({{p0, s32}});
getActionDefinitionsBuilder(G_GEP)
.legalFor({{p0, s32}})
.minScalar(1, s32);
getActionDefinitionsBuilder(G_BRCOND).legalFor({s1});

View File

@@ -7,7 +7,8 @@
define void @test_load_store_64_vfp() #0 { ret void }
define void @test_load_store_64_novfp() #1 { ret void }
define void @test_gep() { ret void }
define void @test_gep_s32() { ret void }
define void @test_gep_s16() { ret void }
attributes #0 = { "target-features"="+vfp2" }
attributes #1 = { "target-features"="-vfp2" }
@@ -165,8 +166,8 @@ body: |
BX_RET 14, $noreg
...
---
name: test_gep
# CHECK-LABEL: name: test_gep
name: test_gep_s32
# CHECK-LABEL: name: test_gep_s32
legalized: false
# CHECK: legalized: true
regBankSelected: false
@@ -189,3 +190,30 @@ body: |
$r0 = COPY %2(p0)
BX_RET 14, $noreg, implicit $r0
...
---
name: test_gep_s16
# CHECK-LABEL: name: test_gep_s16
legalized: false
# CHECK: legalized: true
regBankSelected: false
selected: false
tracksRegLiveness: true
registers:
- { id: 0, class: _ }
- { id: 1, class: _ }
- { id: 2, class: _ }
body: |
bb.0:
liveins: $r0
%0(p0) = COPY $r0
%1(s16) = G_LOAD %0(p0) :: (load 2)
; CHECK-NOT: G_GEP {{%[0-9]+}}, {{%[0-9]+}}(s16)
; CHECK: {{%[0-9]+}}:_(p0) = G_GEP {{%[0-9]+}}, {{%[0-9]+}}(s32)
; CHECK-NOT: G_GEP {{%[0-9]+}}, {{%[0-9]+}}(s16)
%2(p0) = G_GEP %0, %1(s16)
$r0 = COPY %2(p0)
BX_RET 14, $noreg, implicit $r0
...