git: d3899081b93f - stable/15 - Merge commit 5472aa0c1321 from llvm git (by Piotr Kubaj):
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Nov 2026 17:21:55 UTC
The branch stable/15 has been updated by pkubaj:
URL: https://cgit.FreeBSD.org/src/commit/?id=d3899081b93f8ba19d21a01ad42e67b4f5f0a559
commit d3899081b93f8ba19d21a01ad42e67b4f5f0a559
Author: Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-11-17 16:28:06 +0000
Commit: Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-11-24 16:11:19 +0000
Merge commit 5472aa0c1321 from llvm git (by Piotr Kubaj):
[PowerPC] Use the 16-byte stack and vector alignment on FreeBSD (#232336)
FreeBSD uses the ELFv2 ABI on both byte orders, so it has the same
16-byte stack alignment as Linux. The explicit vector alignment is a
backend workaround that does not depend on the OS. There is no
reason for the layouts to differ.
llvm 21 still keeps the data layout in two places, so the check is
changed in both the PowerPC backend and clang. They have to match, or
clang errors out with a data layout mismatch.
Reviewed by: dim
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D61678
(cherry picked from commit d1470ac7f365a1846b8cc565b76592c7a79a22e3)
---
contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 2 +-
contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
index 9f3a4cd2da71..2eee8688db47 100644
--- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
+++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
@@ -473,7 +473,7 @@ public:
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
}
- if (Triple.isOSAIX() || Triple.isOSLinux())
+ if (Triple.isOSAIX() || Triple.isOSLinux() || Triple.isOSFreeBSD())
DataLayout += "-S128-v256:256:256-v512:512:512";
resetDataLayout(DataLayout);
diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
index b5c6ac111dff..484fbbebf060 100644
--- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -195,7 +195,9 @@ static std::string getDataLayoutString(const Triple &T) {
// Specify the vector alignment explicitly. For v256i1 and v512i1, the
// calculated alignment would be 256*alignment(i1) and 512*alignment(i1),
// which is 256 and 512 bytes - way over aligned.
- if (is64Bit && (T.isOSAIX() || T.isOSLinux()))
+ // FreeBSD uses the ELFv2 ABI and has the same 16-byte stack alignment as
+ // Linux.
+ if (is64Bit && (T.isOSAIX() || T.isOSLinux() || T.isOSFreeBSD()))
Ret += "-S128-v256:256:256-v512:512:512";
return Ret;