OSDN Git Service

[ARM GlobalISel] Nothing is legal for Thumb
authorDiana Picus <diana.picus@linaro.org>
Thu, 6 Dec 2018 09:26:14 +0000 (09:26 +0000)
committerDiana Picus <diana.picus@linaro.org>
Thu, 6 Dec 2018 09:26:14 +0000 (09:26 +0000)
...yet!

A lot of the current code should be shared for arm and thumb mode, but
until we add tests and work out some of the details (e.g. checking the
correct subtarget feature for G_SDIV) it's safer to bail out as early as
possible for thumb targets.

This should have arguably been part of r348347, which allowed Thumb
functions to be handled by the IR Translator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348472 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMLegalizerInfo.cpp

index b8f5def..0455f66 100644 (file)
@@ -75,6 +75,13 @@ ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
   const LLT s32 = LLT::scalar(32);
   const LLT s64 = LLT::scalar(64);
 
+  if (ST.isThumb()) {
+    // FIXME: merge with the code for non-Thumb.
+    computeTables();
+    verify(*ST.getInstrInfo());
+    return;
+  }
+
   getActionDefinitionsBuilder(G_GLOBAL_VALUE).legalFor({p0});
   getActionDefinitionsBuilder(G_FRAME_INDEX).legalFor({p0});