[llvm] r360127 - [ARM GlobalISel] Widen G_GEP index operand
Diana Picus via llvm-commits
llvm-commits at lists.llvm.org
Tue May 7 03:11:57 PDT 2019
Author: rovka
Date: Tue May 7 03:11:57 2019
New Revision: 360127
URL: http://llvm.org/viewvc/llvm-project?rev=360127&view=rev
Log:
[ARM GlobalISel] Widen G_GEP index operand
Modified:
llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp
llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalize-load-store.mir
Modified: llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp?rev=360127&r1=360126&r2=360127&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp Tue May 7 03:11:57 2019
@@ -146,7 +146,9 @@ ARMLegalizerInfo::ARMLegalizerInfo(const
.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});
Modified: llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalize-load-store.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalize-load-store.mir?rev=360127&r1=360126&r2=360127&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalize-load-store.mir (original)
+++ llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalize-load-store.mir Tue May 7 03:11:57 2019
@@ -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
@@ -188,4 +189,31 @@ 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
...
More information about the llvm-commits
mailing list