aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-03-27 20:44:20 -0700
committerGitHub <noreply@github.com>2025-03-27 20:44:20 -0700
commit673f4705a827aba52b991d446a90a1c0ca5641a5 (patch)
treef45821848e00931f83d7432c90f0dff843fe519b /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentc9197b27b484713c312c16cad12f9b518c1323c5 (diff)
downloadllvm-673f4705a827aba52b991d446a90a1c0ca5641a5.zip
llvm-673f4705a827aba52b991d446a90a1c0ca5641a5.tar.gz
llvm-673f4705a827aba52b991d446a90a1c0ca5641a5.tar.bz2
[llvm] Use *Set::insert_range (NFC) (#133353)
We can use *Set::insert_range to collapse: for (auto Elem : Range) Set.insert(E.first); down to: Set.insert_range(llvm::make_first_range(Range)); In some cases, we can further fold that into the set declaration.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 5ec7000..a02daad 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -4370,8 +4370,7 @@ private:
// If it does not match, collect all Phi nodes from matcher.
// if we end up with no match, them all these Phi nodes will not match
// later.
- for (auto M : Matched)
- WillNotMatch.insert(M.first);
+ WillNotMatch.insert_range(llvm::make_first_range(Matched));
Matched.clear();
}
if (IsMatched) {