[PATCH] D36326: [MIPS] Use ABI to determine stack alignment.
John Baldwin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 7 14:21:27 PDT 2017
bsdjhb updated this revision to Diff 110086.
bsdjhb added a comment.
Add tests for older -mcpu arguments with N64 ABI.
https://reviews.llvm.org/D36326
Files:
lib/Target/Mips/MipsSubtarget.h
test/CodeGen/Mips/stack-alignment.ll
Index: test/CodeGen/Mips/stack-alignment.ll
===================================================================
--- test/CodeGen/Mips/stack-alignment.ll
+++ test/CodeGen/Mips/stack-alignment.ll
@@ -1,5 +1,7 @@
; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=32
; RUN: llc -march=mipsel -mattr=+fp64 < %s | FileCheck %s -check-prefix=32
+; RUN: llc -march=mips64el -mcpu=mips3 < %s | FileCheck %s -check-prefix=64
+; RUN: llc -march=mips64el -mcpu=mips4 < %s | FileCheck %s -check-prefix=64
; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s -check-prefix=64
; 32: addiu $sp, $sp, -8
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.110086.patch
Type: text/x-patch
Size: 1145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170807/807bec70/attachment.bin>
More information about the llvm-commits
mailing list