[llvm] [BasicBlockSections] Apply path cloning with -basic-block-sections. (PR #68860)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 18 15:57:58 PDT 2023
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 dda46b2e795cb12bc6799e0508d67b4dc72a8469 cbfc2f76886c4311960ccfb70dfba99c27850ae1 -- llvm/lib/CodeGen/BasicBlockPathCloning.cpp llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h llvm/include/llvm/CodeGen/MachineBasicBlock.h llvm/include/llvm/CodeGen/MachineFunction.h llvm/include/llvm/CodeGen/Passes.h llvm/include/llvm/InitializePasses.h llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/lib/CodeGen/BasicBlockSections.cpp llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp llvm/lib/CodeGen/CodeGen.cpp llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/lib/CodeGen/MachineBasicBlock.cpp llvm/lib/CodeGen/MachineFunction.cpp llvm/lib/CodeGen/TargetPassConfig.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/CodeGen/BasicBlockPathCloning.cpp b/llvm/lib/CodeGen/BasicBlockPathCloning.cpp
index 8b146929c8be..51a7caded320 100644
--- a/llvm/lib/CodeGen/BasicBlockPathCloning.cpp
+++ b/llvm/lib/CodeGen/BasicBlockPathCloning.cpp
@@ -178,9 +178,7 @@ public:
initializeBasicBlockPathCloningPass(*PassRegistry::getPassRegistry());
}
- StringRef getPassName() const override {
- return "Basic Block Path Cloning";
- }
+ StringRef getPassName() const override { return "Basic Block Path Cloning"; }
void getAnalysisUsage(AnalysisUsage &AU) const override;
@@ -194,12 +192,13 @@ public:
char BasicBlockPathCloning::ID = 0;
INITIALIZE_PASS_BEGIN(
BasicBlockPathCloning, "bb-path-cloning",
- "Applies path clonings for the -basic-block-sections=list option",
- false, false)
+ "Applies path clonings for the -basic-block-sections=list option", false,
+ false)
INITIALIZE_PASS_DEPENDENCY(BasicBlockSectionsProfileReader)
-INITIALIZE_PASS_END(BasicBlockPathCloning, "bb-path-cloning",
- "Applies path clonings for the -basic-block-sections=list option",
- false, false)
+INITIALIZE_PASS_END(
+ BasicBlockPathCloning, "bb-path-cloning",
+ "Applies path clonings for the -basic-block-sections=list option", false,
+ false)
bool BasicBlockPathCloning::runOnMachineFunction(MachineFunction &MF) {
auto BBSectionsType = MF.getTarget().getBBSectionsType();
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index e605fbefbd75..fd71756a8a40 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -1174,7 +1174,7 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge(
// If updateTerminator() removes instructions, we need to remove them from
// SlotIndexes.
- SmallVector<MachineInstr*, 4> Terminators;
+ SmallVector<MachineInstr *, 4> Terminators;
if (Indexes) {
for (MachineInstr &MI :
llvm::make_range(getFirstInstrTerminator(), instr_end()))
@@ -1190,7 +1190,7 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge(
updateTerminator(PrevFallthrough);
if (Indexes) {
- SmallVector<MachineInstr*, 4> NewTerminators;
+ SmallVector<MachineInstr *, 4> NewTerminators;
for (MachineInstr &MI :
llvm::make_range(getFirstInstrTerminator(), instr_end()))
NewTerminators.push_back(&MI);
``````````
</details>
https://github.com/llvm/llvm-project/pull/68860
More information about the llvm-commits
mailing list