summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-02-06 21:56:47 +0000
committerTim Northover <tnorthover@apple.com>2017-02-06 21:56:47 +0000
commit0e6afbdd77f5575b46640a48f35b8c53a2357732 (patch)
treefd3687820f10d30c703e7665a045198ff9809b01 /llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
parent90562dfb508e15f1af6dcc0c7f703f48cee5cf02 (diff)
downloadbcm5719-llvm-0e6afbdd77f5575b46640a48f35b8c53a2357732.tar.gz
bcm5719-llvm-0e6afbdd77f5575b46640a48f35b8c53a2357732.zip
GlobalISel: legalize G_INSERT instructions
We don't handle all cases yet (see arm64-fallback.ll for an example), but this is enough to cover most common C++ code so it's a good place to start. llvm-svn: 294247
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
index 86037c97731..838cb673b1a 100644
--- a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
@@ -78,6 +78,18 @@ AArch64LegalizerInfo::AArch64LegalizerInfo() {
setAction({G_FREM, s32}, Libcall);
setAction({G_FREM, s64}, Libcall);
+ // FIXME: what should we do about G_INSERTs with more than one source value?
+ // For now the default of not specifying means we'll fall back.
+ for (auto Ty : {s32, s64}) {
+ setAction({G_INSERT, Ty}, Legal);
+ setAction({G_INSERT, 1, Ty}, Legal);
+ }
+ for (auto Ty : {s1, s8, s16}) {
+ setAction({G_INSERT, Ty}, WidenScalar);
+ // FIXME: Can't widen the sources because that violates the constraints on
+ // G_INSERT (It seems entirely reasonable that inputs shouldn't overlap).
+ }
+
for (unsigned MemOp : {G_LOAD, G_STORE}) {
for (auto Ty : {s8, s16, s32, s64, p0, v2s32})
setAction({MemOp, Ty}, Legal);
OpenPOWER on IntegriCloud