aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/AutoUpgrade.cpp
diff options
context:
space:
mode:
authorDoug Wyatt <doug@sonosphere.com>2024-05-05 19:05:15 -0700
committerGitHub <noreply@github.com>2024-05-05 19:05:15 -0700
commitddecadabebdd4b301bd65534b58009e57ac1bbe5 (patch)
tree2cd3ffa8cccf12535c5c000b40d1baa837012ef0 /llvm/lib/IR/AutoUpgrade.cpp
parente12364301e3370456e610c3f23ca18050f61f77e (diff)
downloadllvm-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.cpp8
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;