[PATCH] D70018: [mips][test] Check if the subtarget can support the requested triple width

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 02:33:32 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG068db2ed4d18: [mips] Show an error if 64-bit target triple provided with 32-bit CPU (authored by atanasyan).
Herald added a subscriber: jrtc27.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70018/new/

https://reviews.llvm.org/D70018

Files:
  llvm/lib/Target/Mips/MipsSubtarget.cpp
  llvm/test/CodeGen/Mips/cpus-no-mips64.ll


Index: llvm/test/CodeGen/Mips/cpus-no-mips64.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/Mips/cpus-no-mips64.ll
@@ -0,0 +1,16 @@
+; Check that we reject 64-bit mode on 32-bit only CPUs.
+
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips1 2>&1 | FileCheck %s
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips2 2>&1 | FileCheck %s
+
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips32 2>&1 | FileCheck %s
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips32r2 2>&1 | FileCheck %s
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips32r3 2>&1 | FileCheck %s
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips32r5 2>&1 | FileCheck %s
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips32r6 2>&1 | FileCheck %s
+
+; CHECK: LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it!
+
+define void @foo() {
+  ret void
+}
Index: llvm/lib/Target/Mips/MipsSubtarget.cpp
===================================================================
--- llvm/lib/Target/Mips/MipsSubtarget.cpp
+++ llvm/lib/Target/Mips/MipsSubtarget.cpp
@@ -256,6 +256,10 @@
     stackAlignment = Align(8);
   }
 
+  if ((isABI_N32() || isABI_N64()) && !isGP64bit())
+    report_fatal_error("64-bit code requested on a subtarget that doesn't "
+                       "support it!");
+
   return *this;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70018.229042.patch
Type: text/x-patch
Size: 1419 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191113/02790d44/attachment-0001.bin>


More information about the llvm-commits mailing list