[llvm] [ARM] Avoid repeated hash lookups (NFC) (PR #109602)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 22 21:06:16 PDT 2024
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/109602
None
>From 46f9ffe1888f5e154fd19ba30ed4266965a57fdc Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 22 Sep 2024 08:06:50 -0700
Subject: [PATCH] [ARM] Avoid repeated hash lookups (NFC)
---
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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