[llvm] cee6509 - [ARM] Avoid repeated hash lookups (NFC) (#109602)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 23 06:42:11 PDT 2024
Author: Kazu Hirata
Date: 2024-09-23T06:42:06-07:00
New Revision: cee65092c95a216e63d970b5da1495eb33dd506a
URL: https://github.com/llvm/llvm-project/commit/cee65092c95a216e63d970b5da1495eb33dd506a
DIFF: https://github.com/llvm/llvm-project/commit/cee65092c95a216e63d970b5da1495eb33dd506a.diff
LOG: [ARM] Avoid repeated hash lookups (NFC) (#109602)
Added:
Modified:
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
index a4598de96fa3b4..e7dfbfb64fa521 100644
--- a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
+++ b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
@@ -144,10 +144,9 @@ namespace {
void ProcessLoop() {
std::function<void(MachineBasicBlock *)> Search =
[this, &Search](MachineBasicBlock *MBB) -> void {
- if (Visited.count(MBB))
+ if (!Visited.insert(MBB).second)
return;
- Visited.insert(MBB);
for (auto *Succ : MBB->successors()) {
if (!ML.contains(Succ))
continue;
More information about the llvm-commits
mailing list