[llvm] [AMDGPU] Avoid repeated hash lookups (NFC) (PR #109506)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 20:39:52 PDT 2024
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/109506
None
>From fc32a6ffdc47fd1064ac72c900459ef4f373e889 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 20 Sep 2024 13:36:12 -0700
Subject: [PATCH] [AMDGPU] Avoid repeated hash lookups (NFC)
---
llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
index 36dfebacaed686..3767a6b379f81c 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
@@ -296,9 +296,8 @@ bool LiveRegOptimizer::optimizeLiveType(
// Collect all uses of PHINodes and any use the crosses BB boundaries.
if (UseInst->getParent() != II->getParent() || isa<PHINode>(II)) {
Uses.insert(UseInst);
- if (!Defs.count(II) && !isa<PHINode>(II)) {
+ if (!isa<PHINode>(II))
Defs.insert(II);
- }
}
}
}
More information about the llvm-commits
mailing list