[llvm] [BOLT][RISCV] Handle cross-fragment branches in split functions (PR #223958)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 02:50:08 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 h,cpp -- bolt/include/bolt/Passes/RISCVLongJmpPass.h bolt/lib/Passes/RISCVLongJmpPass.cpp bolt/include/bolt/Core/MCPlusBuilder.h bolt/lib/Rewrite/BinaryPassManager.cpp bolt/lib/Target/RISCV/RISCVMCPlusBuilder.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/RISCVLongJmpPass.cpp b/bolt/lib/Passes/RISCVLongJmpPass.cpp
index f51b48c16..9b01b0dbf 100644
--- a/bolt/lib/Passes/RISCVLongJmpPass.cpp
+++ b/bolt/lib/Passes/RISCVLongJmpPass.cpp
@@ -1,4 +1,5 @@
-//===- RISCVLongJmpPass.cpp ------------------------------------------------===//
+//===- RISCVLongJmpPass.cpp
+//------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -85,7 +86,8 @@ void keepFragmentsTogether(BinaryFunction &BF) {
/// Insert a stub for every cross-fragment CFG edge, without estimating its
/// final distance. Return false if splitting was cancelled for lack of scratch.
-/// Analyze all edges before mutating the CFG so fallback needs no stub rollback.
+/// Analyze all edges before mutating the CFG so fallback needs no stub
+/// rollback.
bool relaxFunction(BinaryFunction &BF, RegAnalysis &RA) {
BinaryContext &BC = BF.getBinaryContext();
BitVector Candidates = getScratchRegCandidates(BF);
diff --git a/bolt/lib/Rewrite/BinaryPassManager.cpp b/bolt/lib/Rewrite/BinaryPassManager.cpp
index 48de32077..d4e7426ea 100644
--- a/bolt/lib/Rewrite/BinaryPassManager.cpp
+++ b/bolt/lib/Rewrite/BinaryPassManager.cpp
@@ -29,8 +29,8 @@
#include "bolt/Passes/PointerAuthCFIAnalyzer.h"
#include "bolt/Passes/PointerAuthCFIFixup.h"
#include "bolt/Passes/ProfileQualityStats.h"
-#include "bolt/Passes/RegReAssign.h"
#include "bolt/Passes/RISCVLongJmpPass.h"
+#include "bolt/Passes/RegReAssign.h"
#include "bolt/Passes/ReorderData.h"
#include "bolt/Passes/ReorderFunctions.h"
#include "bolt/Passes/RetpolineInsertion.h"
diff --git a/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp b/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
index f459ee6cd..7a325aade 100644
--- a/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
+++ b/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
@@ -329,7 +329,8 @@ public:
Inst = MCInstBuilder(RISCV::PseudoJump)
.addReg(ScratchReg)
.addExpr(MCSpecifierExpr::create(
- MCSymbolRefExpr::create(Target, *Ctx), RISCV::S_CALL_PLT, *Ctx));
+ MCSymbolRefExpr::create(Target, *Ctx), RISCV::S_CALL_PLT,
+ *Ctx));
}
StringRef getTrapFillValue() const override {
``````````
</details>
https://github.com/llvm/llvm-project/pull/223958
More information about the llvm-commits
mailing list