From b498a8991ed00bda6b4094d0303f163cfc236e32 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 30 Jul 2022 10:35:49 -0700 Subject: [PATCH] [bolt] Remove redundaunt control-flow statements (NFC) Identified with readability-redundant-control-flow. --- bolt/include/bolt/Core/BinaryFunction.h | 1 - bolt/lib/Core/BinaryFunction.cpp | 1 - bolt/lib/Core/BinaryFunctionProfile.cpp | 2 -- bolt/lib/Passes/MCF.cpp | 2 -- bolt/lib/Passes/ReorderAlgorithm.cpp | 1 - bolt/lib/Profile/DataAggregator.cpp | 2 -- 6 files changed, 9 deletions(-) diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h index 16c0ea3d75c7..886503805acf 100644 --- a/bolt/include/bolt/Core/BinaryFunction.h +++ b/bolt/include/bolt/Core/BinaryFunction.h @@ -1652,7 +1652,6 @@ public: } OffsetToCFI.emplace(Offset, FrameInstructions.size()); FrameInstructions.emplace_back(std::forward(Inst)); - return; } BinaryBasicBlock::iterator addCFIInstruction(BinaryBasicBlock *BB, diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index b571b320f544..7ee425568bad 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -2614,7 +2614,6 @@ bool BinaryFunction::replayCFIInstrs(int32_t FromState, int32_t ToState, // so we might as well fall-through here. } NewCFIs.push_back(CurState); - continue; } // Replay instructions while avoiding duplicates diff --git a/bolt/lib/Core/BinaryFunctionProfile.cpp b/bolt/lib/Core/BinaryFunctionProfile.cpp index ca9cf50799fd..0d705cd82f5d 100644 --- a/bolt/lib/Core/BinaryFunctionProfile.cpp +++ b/bolt/lib/Core/BinaryFunctionProfile.cpp @@ -339,8 +339,6 @@ void BinaryFunction::inferFallThroughCounts() { } } } - - return; } void BinaryFunction::clearProfile() { diff --git a/bolt/lib/Passes/MCF.cpp b/bolt/lib/Passes/MCF.cpp index e92202aea4ba..e7ca31e669b7 100644 --- a/bolt/lib/Passes/MCF.cpp +++ b/bolt/lib/Passes/MCF.cpp @@ -86,7 +86,6 @@ void updateEdgeWeight(EdgeWeightMap &EdgeWeights, const BinaryBasicBlock *B, double Weight) { EdgeWeights[std::make_pair(A, B)] = Weight; - return; } template <> @@ -95,7 +94,6 @@ void updateEdgeWeight>(EdgeWeightMap &EdgeWeights, const BinaryBasicBlock *B, double Weight) { EdgeWeights[std::make_pair(B, A)] = Weight; - return; } template diff --git a/bolt/lib/Passes/ReorderAlgorithm.cpp b/bolt/lib/Passes/ReorderAlgorithm.cpp index 0a69f711a46f..bc0df798834e 100644 --- a/bolt/lib/Passes/ReorderAlgorithm.cpp +++ b/bolt/lib/Passes/ReorderAlgorithm.cpp @@ -250,7 +250,6 @@ void PHGreedyClusterAlgorithm::initQueue(std::vector &Queue, void PHGreedyClusterAlgorithm::adjustQueue(std::vector &Queue, const BinaryFunction &BF) { // Nothing to do. - return; } bool PHGreedyClusterAlgorithm::areClustersCompatible(const ClusterTy &Front, diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp index 885a54fa3c96..8e500ca2efb2 100644 --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -316,8 +316,6 @@ void DataAggregator::processFileBuildID(StringRef FileBuildID) { } else { outs() << "PERF2BOLT: matched build-id and file name\n"; } - - return; } bool DataAggregator::checkPerfDataMagic(StringRef FileName) {