[llvm] r296468 - [ARM] GlobalISel: Legalize 32-bit constants
Diana Picus via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 28 03:33:46 PST 2017
Author: rovka
Date: Tue Feb 28 05:33:46 2017
New Revision: 296468
URL: http://llvm.org/viewvc/llvm-project?rev=296468&view=rev
Log:
[ARM] GlobalISel: Legalize 32-bit constants
Modified:
llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp
llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir
Modified: llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp?rev=296468&r1=296467&r2=296468&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMLegalizerInfo.cpp Tue Feb 28 05:33:46 2017
@@ -55,6 +55,8 @@ ARMLegalizerInfo::ARMLegalizerInfo(const
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);
Modified: llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir?rev=296468&r1=296467&r2=296468&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir (original)
+++ llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir Tue Feb 28 05:33:46 2017
@@ -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
More information about the llvm-commits
mailing list