Skip to content

Commit

Permalink
[llvm-exegesis] Use range-based for loops (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Sep 9, 2023
1 parent 8a2d68f commit c7b25fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions llvm/tools/llvm-exegesis/lib/Clustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,8 @@ void BenchmarkClustering::stabilize(unsigned NumOpcodes) {
assert(std::distance(it, OldCluster.PointIndices.end()) > 0 &&
"Should have found at least one bad point");
// Mark to-be-moved points as belonging to the new cluster.
std::for_each(it, OldCluster.PointIndices.end(),
[this, &UnstableCluster](size_t P) {
ClusterIdForPoint_[P] = UnstableCluster.Id;
});
for (size_t P : llvm::make_range(it, OldCluster.PointIndices.end()))
ClusterIdForPoint_[P] = UnstableCluster.Id;
// Actually append to-be-moved points to the new cluster.
UnstableCluster.PointIndices.insert(UnstableCluster.PointIndices.end(),
it, OldCluster.PointIndices.end());
Expand Down
7 changes: 2 additions & 5 deletions llvm/tools/llvm-exegesis/llvm-exegesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,8 @@ void benchmarkMain() {
}

BitVector AllReservedRegs;
llvm::for_each(Repetitors,
[&AllReservedRegs](
const std::unique_ptr<const SnippetRepetitor> &Repetitor) {
AllReservedRegs |= Repetitor->getReservedRegs();
});
for (const std::unique_ptr<const SnippetRepetitor> &Repetitor : Repetitors)
AllReservedRegs |= Repetitor->getReservedRegs();

std::vector<BenchmarkCode> Configurations;
if (!Opcodes.empty()) {
Expand Down

0 comments on commit c7b25fa

Please sign in to comment.