[llvm] [BOLT][AArch64] Add call relaxation pass (PR #173952)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 16:58:09 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- bolt/include/bolt/Core/BinaryContext.h bolt/include/bolt/Passes/LongJmp.h bolt/lib/Core/BinaryContext.cpp bolt/lib/Passes/BinaryPasses.cpp bolt/lib/Passes/LongJmp.cpp bolt/lib/Rewrite/BinaryPassManager.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/bolt/lib/Passes/LongJmp.cpp b/bolt/lib/Passes/LongJmp.cpp
index 6fd39cc0a..0c27bf3ef 100644
--- a/bolt/lib/Passes/LongJmp.cpp
+++ b/bolt/lib/Passes/LongJmp.cpp
@@ -1345,7 +1345,7 @@ Error LongJmpPass::runOnFunctions(BinaryContext &BC) {
     auto It = BranchLiveness.find(&BF);
     return It == BranchLiveness.end() ? nullptr : &It->second;
   };
-  
+
   if (opts::CompactCodeModel || opts::ExperimentalRelaxation) {
     BC.outs()
         << "BOLT-INFO: relaxing branches for compact code model (<128MB)\n";
@@ -1368,14 +1368,14 @@ Error LongJmpPass::runOnFunctions(BinaryContext &BC) {
     // The error has already been reported by relaxLocalBranches().
     if (HasFatal)
       return createFatalBOLTError("branch relaxation failure");
-    
+
     if (!opts::ExperimentalRelaxation) {
       return Error::success();
-      
-    BC.outs() << "BOLT-INFO: starting experimental relaxation pass\n";
-    relaxCalls(BC);
-    return Error::success();
-  }
+
+      BC.outs() << "BOLT-INFO: starting experimental relaxation pass\n";
+      relaxCalls(BC);
+      return Error::success();
+    }
 
   BC.outs() << "BOLT-INFO: Starting stub-insertion pass\n";
   BinaryFunctionListType Sorted = BC.getOutputBinaryFunctions();
@@ -1400,6 +1400,6 @@ Error LongJmpPass::runOnFunctions(BinaryContext &BC) {
             << " stubs in the cold area. Shared " << NumSharedStubs
             << " times, iterated " << Iterations << " times.\n";
   return Error::success();
-}
+  }
 } // namespace bolt
 } // namespace llvm

``````````

</details>


https://github.com/llvm/llvm-project/pull/173952


More information about the llvm-commits mailing list