[PATCH] D36326: [MIPS] Use ABI to determine stack alignment.

John Baldwin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 09:48:43 PDT 2017


bsdjhb created this revision.
Herald added a subscriber: arichardson.

The stack alignment depends on the ABI (16 bytes for N32 and N64 and 8
bytes for O32), not the CPU type.


https://reviews.llvm.org/D36326

Files:
  lib/Target/Mips/MipsSubtarget.h


Index: lib/Target/Mips/MipsSubtarget.h
===================================================================
--- lib/Target/Mips/MipsSubtarget.h
+++ lib/Target/Mips/MipsSubtarget.h
@@ -295,7 +295,9 @@
   // really use them if in addition we are in mips16 mode
   static bool useConstantIslands();
 
-  unsigned stackAlignment() const { return hasMips64() ? 16 : 8; }
+  unsigned stackAlignment() const {
+    return isABI_N32() || isABI_N64() ? 16 : 8;
+  }
 
   // Grab relocation model
   Reloc::Model getRelocationModel() const;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36326.109766.patch
Type: text/x-patch
Size: 530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170804/dfd0274b/attachment.bin>


More information about the llvm-commits mailing list