aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2018-12-12 10:32:15 +0000
committerDiana Picus <diana.picus@linaro.org>2018-12-12 10:32:15 +0000
commit59720b422abfc090aadf246eb3c7fc583aeb2693 (patch)
treeedb0b66ce77db5f35fce3ce5563a7927f8304936 /llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
parent87a7e436c0b9b248aa99741815b23c58a648e1a6 (diff)
downloadllvm-59720b422abfc090aadf246eb3c7fc583aeb2693.zip
llvm-59720b422abfc090aadf246eb3c7fc583aeb2693.tar.gz
llvm-59720b422abfc090aadf246eb3c7fc583aeb2693.tar.bz2
[ARM GlobalISel] Select load/store for Thumb2
Unfortunately we can't use TableGen for this because it doesn't yet support predicates on the source pattern root. Therefore, add a bit of handwritten code to the instruction selector to handle the most basic cases. Also mark them as legal and extract their legalizer test cases to a new test file. llvm-svn: 348920
Diffstat (limited to 'llvm/lib/Target/ARM/ARMLegalizerInfo.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMLegalizerInfo.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
index 0455f668..2edeeac 100644
--- a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
@@ -75,6 +75,24 @@ ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
const LLT s32 = LLT::scalar(32);
const LLT s64 = LLT::scalar(64);
+ if (ST.isThumb1Only()) {
+ // Thumb1 is not supported yet.
+ computeTables();
+ verify(*ST.getInstrInfo());
+ return;
+ }
+
+ // We're keeping these builders around because we'll want to add support for
+ // floating point to them.
+ auto &LoadStoreBuilder =
+ getActionDefinitionsBuilder({G_LOAD, G_STORE})
+ .legalForTypesWithMemSize({
+ {s1, p0, 8},
+ {s8, p0, 8},
+ {s16, p0, 16},
+ {s32, p0, 32},
+ {p0, p0, 32}});
+
if (ST.isThumb()) {
// FIXME: merge with the code for non-Thumb.
computeTables();
@@ -149,10 +167,6 @@ ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
// We're keeping these builders around because we'll want to add support for
// floating point to them.
- auto &LoadStoreBuilder =
- getActionDefinitionsBuilder({G_LOAD, G_STORE})
- .legalForCartesianProduct({s1, s8, s16, s32, p0}, {p0});
-
auto &PhiBuilder =
getActionDefinitionsBuilder(G_PHI).legalFor({s32, p0}).minScalar(0, s32);