summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2017-02-28 11:33:46 +0000
committerDiana Picus <diana.picus@linaro.org>2017-02-28 11:33:46 +0000
commite6beac674235dda4dae3e25eee51a36518d44069 (patch)
tree635dd7ad4a5ff0fb291975c5a4b8202e5b501f54
parentbb46a7dd2aa6a725dd2825c2f66a2f61719ba84f (diff)
downloadbcm5719-llvm-e6beac674235dda4dae3e25eee51a36518d44069.tar.gz
bcm5719-llvm-e6beac674235dda4dae3e25eee51a36518d44069.zip
[ARM] GlobalISel: Legalize 32-bit constants
llvm-svn: 296468
-rw-r--r--llvm/lib/Target/ARM/ARMLegalizerInfo.cpp2
-rw-r--r--llvm/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir20
2 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
index 32604811ab9..cc30547a7b4 100644
--- a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
@@ -55,6 +55,8 @@ ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
setAction({G_GEP, p0}, Legal);
setAction({G_GEP, 1, s32}, Legal);
+ setAction({G_CONSTANT, s32}, Legal);
+
if (ST.hasVFP2()) {
setAction({G_FADD, s32}, Legal);
setAction({G_FADD, s64}, Legal);
diff --git a/llvm/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir b/llvm/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir
index edd8c3ac8f4..cbff7e12fb7 100644
--- a/llvm/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir
+++ b/llvm/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir
@@ -13,6 +13,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 }
@@ -269,6 +271,24 @@ body: |
BX_RET 14, _, implicit %r0
...
---
+name: test_constants
+# CHECK-LABEL: name: test_constants
+legalized: false
+# CHECK: legalized: true
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+registers:
+ - { id: 0, class: _ }
+body: |
+ bb.0:
+ %0(s32) = G_CONSTANT 42
+ ; CHECK: {{%[0-9]+}}(s32) = G_CONSTANT 42
+
+ %r0 = COPY %0(s32)
+ BX_RET 14, _, implicit %r0
+...
+---
name: test_fadd_s32
# CHECK-LABEL: name: test_fadd_s32
legalized: false
OpenPOWER on IntegriCloud