diff options
author | Doug Wyatt <doug@sonosphere.com> | 2024-05-05 19:05:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-05 19:05:15 -0700 |
commit | ddecadabebdd4b301bd65534b58009e57ac1bbe5 (patch) | |
tree | 2cd3ffa8cccf12535c5c000b40d1baa837012ef0 /llvm/lib/IR/AutoUpgrade.cpp | |
parent | e12364301e3370456e610c3f23ca18050f61f77e (diff) | |
download | llvm-ddecadabebdd4b301bd65534b58009e57ac1bbe5.zip llvm-ddecadabebdd4b301bd65534b58009e57ac1bbe5.tar.gz llvm-ddecadabebdd4b301bd65534b58009e57ac1bbe5.tar.bz2 |
[clang backend] In AArch64's DataLayout, specify a minimum function alignment of 4. (#90702)
This addresses an issue where the explicit alignment of 2 (for C++ ABI
reasons) was being propagated to the back end and causing under-aligned
functions (in special sections).
This is an alternate approach suggested by @efriedma-quic in PR #90415.
Fixes #90358
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
-rw-r--r-- | llvm/lib/IR/AutoUpgrade.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index 5c65efb..a7ed2de 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -5406,6 +5406,14 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) { return Res; } + // AArch64 data layout upgrades. + if (T.isAArch64()) { + // Add "-Fn32" + if (!DL.empty() && !DL.contains("-Fn32")) + Res.append("-Fn32"); + return Res; + } + if (!T.isX86()) return Res; |