[clang] df3bda0 - [VE] Correct stack alignment
Kazushi Marukawa via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 6 01:25:44 PDT 2020
Author: Kazushi (Jam) Marukawa
Date: 2020-07-06T17:25:29+09:00
New Revision: df3bda047d5abe9190bdd0422270328140556bd4
URL: https://github.com/llvm/llvm-project/commit/df3bda047d5abe9190bdd0422270328140556bd4
DIFF: https://github.com/llvm/llvm-project/commit/df3bda047d5abe9190bdd0422270328140556bd4.diff
LOG: [VE] Correct stack alignment
Summary:
Change stack alignment from 64 bits to 128 bits to follow ABI correctly.
And add a regression test for datalayout.
Reviewers: simoll, k-ishizaka
Reviewed By: simoll
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #llvm, #ve, #clang
Differential Revision: https://reviews.llvm.org/D83173
Added:
Modified:
clang/lib/Basic/Targets/VE.h
clang/test/CodeGen/target-data.c
llvm/lib/Target/VE/VETargetMachine.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/VE.h b/clang/lib/Basic/Targets/VE.h
index 7e50e7daeb90..f863a0af0acb 100644
--- a/clang/lib/Basic/Targets/VE.h
+++ b/clang/lib/Basic/Targets/VE.h
@@ -45,7 +45,7 @@ class LLVM_LIBRARY_VISIBILITY VETargetInfo : public TargetInfo {
WCharType = UnsignedInt;
WIntType = UnsignedInt;
UseZeroLengthBitfieldAlignment = true;
- resetDataLayout("e-m:e-i64:64-n32:64-S64");
+ resetDataLayout("e-m:e-i64:64-n32:64-S128");
}
void getTargetDefines(const LangOptions &Opts,
diff --git a/clang/test/CodeGen/target-data.c b/clang/test/CodeGen/target-data.c
index e619843f4bdb..8c740119cd1b 100644
--- a/clang/test/CodeGen/target-data.c
+++ b/clang/test/CodeGen/target-data.c
@@ -250,3 +250,7 @@
// RUN: %clang_cc1 -triple bpfeb -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=BPFEB
// BPFEB: target datalayout = "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
+
+// RUN: %clang_cc1 -triple ve -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=VE
+// VE: target datalayout = "e-m:e-i64:64-n32:64-S128"
diff --git a/llvm/lib/Target/VE/VETargetMachine.cpp b/llvm/lib/Target/VE/VETargetMachine.cpp
index a0c8ae0c82d7..08b55eebbc98 100644
--- a/llvm/lib/Target/VE/VETargetMachine.cpp
+++ b/llvm/lib/Target/VE/VETargetMachine.cpp
@@ -41,8 +41,8 @@ static std::string computeDataLayout(const Triple &T) {
// VE supports 32 bit and 64 bits integer on registers
Ret += "-n32:64";
- // Stack alignment is 64 bits
- Ret += "-S64";
+ // Stack alignment is 128 bits
+ Ret += "-S128";
return Ret;
}
More information about the cfe-commits
mailing list