aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-08-19 22:40:00 +0000
committerTim Northover <tnorthover@apple.com>2016-08-19 22:40:00 +0000
commitea904f9424cc37c5ff7ac595e465ede2a10fdf0d (patch)
treea6f53aec83820790c56ad70b565f333f940ad292 /llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
parentfa7de606c439d90665ef25f0c6d447a9476c2fc6 (diff)
downloadllvm-ea904f9424cc37c5ff7ac595e465ede2a10fdf0d.zip
llvm-ea904f9424cc37c5ff7ac595e465ede2a10fdf0d.tar.gz
llvm-ea904f9424cc37c5ff7ac595e465ede2a10fdf0d.tar.bz2
GlobalISel: teach legalizer how to handle integer constants.
llvm-svn: 279340
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
index 36f7f4e..a06eee0 100644
--- a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
+++ b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
@@ -26,6 +26,7 @@ using namespace llvm;
AArch64MachineLegalizer::AArch64MachineLegalizer() {
using namespace TargetOpcode;
+ const LLT s1 = LLT::scalar(1);
const LLT s8 = LLT::scalar(8);
const LLT s16 = LLT::scalar(16);
const LLT s32 = LLT::scalar(32);
@@ -54,6 +55,14 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() {
for (auto Ty : {s32, s64})
setAction(MemOp, Ty, Legal);
+ for (auto Ty : {s32, s64}) {
+ setAction(TargetOpcode::G_CONSTANT, Ty, Legal);
+ setAction(TargetOpcode::G_FCONSTANT, Ty, Legal);
+ }
+
+ for (auto Ty : {s1, s8, s16})
+ setAction(TargetOpcode::G_CONSTANT, Ty, WidenScalar);
+
setAction(G_BR, LLT::unsized(), Legal);