Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[BOLT] Use llvm::max_element (NFC) #140342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 17, 2025

@llvm/pr-subscribers-bolt

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/140342.diff

1 Files Affected:

  • (modified) bolt/lib/Passes/PettisAndHansen.cpp (+4-5)
diff --git a/bolt/lib/Passes/PettisAndHansen.cpp b/bolt/lib/Passes/PettisAndHansen.cpp
index f138c609b689a..ab466ab47dcb0 100644
--- a/bolt/lib/Passes/PettisAndHansen.cpp
+++ b/bolt/lib/Passes/PettisAndHansen.cpp
@@ -143,11 +143,10 @@ std::vector<Cluster> pettisAndHansen(const CallGraph &Cg) {
   // Find an arc with max weight and merge its nodes
 
   while (!Carcs.empty()) {
-    auto Maxpos =
-        std::max_element(Carcs.begin(), Carcs.end(),
-                         [&](const ClusterArc &Carc1, const ClusterArc &Carc2) {
-                           return Carc1.Weight < Carc2.Weight;
-                         });
+    auto Maxpos = llvm::max_element(
+        Carcs, [&](const ClusterArc &Carc1, const ClusterArc &Carc2) {
+          return Carc1.Weight < Carc2.Weight;
+        });
 
     ClusterArc Max = *Maxpos;
     Carcs.erase(Maxpos);

@kazutakahirata kazutakahirata merged commit 9523062 into llvm:main May 17, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_range_llvm_max_element_bolt branch May 17, 2025 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.