[llvm] [BOLT][AArch64] Don't change layout in PatchEntries (PR #71278)
Vladislav Khmelevsky via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 4 04:36:19 PDT 2023
https://github.com/yota9 updated https://github.com/llvm/llvm-project/pull/71278
>From 80c55318fcb8c6ed1b8c6818f6c5e3c70f22a5fd Mon Sep 17 00:00:00 2001
From: Vladislav Khmelevsky <och95 at yandex.ru>
Date: Sat, 4 Nov 2023 15:00:31 +0400
Subject: [PATCH] [BOLT][AArch64] Don't change layout in PatchEntries
Due to LongJmp pass that is executed before PatchEntries we can't ignore
the function here since it would change pre-calculated output layout.
This is also attemp to fix #70771
---
bolt/lib/Passes/PatchEntries.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/bolt/lib/Passes/PatchEntries.cpp b/bolt/lib/Passes/PatchEntries.cpp
index 02a044d8b2f69f5..ee7512d89962f69 100644
--- a/bolt/lib/Passes/PatchEntries.cpp
+++ b/bolt/lib/Passes/PatchEntries.cpp
@@ -98,6 +98,17 @@ void PatchEntries::runOnFunctions(BinaryContext &BC) {
});
if (!Success) {
+ // We can't change output layout for AArch64 due to LongJmp pass
+ if (BC.isAArch64()) {
+ if (opts::ForcePatch) {
+ errs() << "BOLT-ERROR: unable to patch entries in " << Function
+ << "\n";
+ exit(1);
+ }
+
+ continue;
+ }
+
// If the original function entries cannot be patched, then we cannot
// safely emit new function body.
errs() << "BOLT-WARNING: failed to patch entries in " << Function
More information about the llvm-commits
mailing list