kaz7 created this revision. kaz7 added reviewers: simoll, k-ishizaka. kaz7 added projects: LLVM, VE. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added a project: clang.
Change stack alignment from 64 bits to 128 bits to follow ABI correctly. And add a regression test for datalayout. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D83173 Files: clang/lib/Basic/Targets/VE.h clang/test/CodeGen/target-data.c llvm/lib/Target/VE/VETargetMachine.cpp Index: llvm/lib/Target/VE/VETargetMachine.cpp =================================================================== --- llvm/lib/Target/VE/VETargetMachine.cpp +++ llvm/lib/Target/VE/VETargetMachine.cpp @@ -41,8 +41,8 @@ // 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; } Index: clang/test/CodeGen/target-data.c =================================================================== --- clang/test/CodeGen/target-data.c +++ 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" Index: clang/lib/Basic/Targets/VE.h =================================================================== --- clang/lib/Basic/Targets/VE.h +++ clang/lib/Basic/Targets/VE.h @@ -45,7 +45,7 @@ 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,
Index: llvm/lib/Target/VE/VETargetMachine.cpp =================================================================== --- llvm/lib/Target/VE/VETargetMachine.cpp +++ llvm/lib/Target/VE/VETargetMachine.cpp @@ -41,8 +41,8 @@ // 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; } Index: clang/test/CodeGen/target-data.c =================================================================== --- clang/test/CodeGen/target-data.c +++ 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" Index: clang/lib/Basic/Targets/VE.h =================================================================== --- clang/lib/Basic/Targets/VE.h +++ clang/lib/Basic/Targets/VE.h @@ -45,7 +45,7 @@ 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,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits