[llvm] [BOLT] RepRet is X86-specific (PR #88286)

Nathan Sidwell via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 08:52:27 PDT 2024


https://github.com/urnathan created https://github.com/llvm/llvm-project/pull/88286

Bolt's RepRet pass is x86-specific, no need to add it for non-x86 targets. (Note, there's an AArch64 equivalent further down where ADRRelaxation only gets added for that target.)

>From e9f74a5988eee5db7f6be7b46e5d54a34017a332 Mon Sep 17 00:00:00 2001
From: Nathan Sidwell <nathan at acm.org>
Date: Wed, 10 Apr 2024 11:50:31 -0400
Subject: [PATCH] [BOLT] RepRet is X86-specific

---
 bolt/lib/Rewrite/BinaryPassManager.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bolt/lib/Rewrite/BinaryPassManager.cpp b/bolt/lib/Rewrite/BinaryPassManager.cpp
index 6c26bb7957269d..be4888ccfa5645 100644
--- a/bolt/lib/Rewrite/BinaryPassManager.cpp
+++ b/bolt/lib/Rewrite/BinaryPassManager.cpp
@@ -377,8 +377,9 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
 
   Manager.registerPass(std::make_unique<NormalizeCFG>(PrintNormalized));
 
-  Manager.registerPass(std::make_unique<StripRepRet>(NeverPrint),
-                       opts::StripRepRet);
+  if (BC.isX86())
+    Manager.registerPass(std::make_unique<StripRepRet>(NeverPrint),
+                         opts::StripRepRet);
 
   Manager.registerPass(std::make_unique<IdenticalCodeFolding>(PrintICF),
                        opts::ICF);



More information about the llvm-commits mailing list