[llvm] [AMDGPU] Avoid repeated hash lookups (NFC) (PR #109506)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 20:55:53 PDT 2024
================
@@ -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)) {
----------------
kazutakahirata wrote:
`Defs.count(II)` is redundant because `Defs.insert(II)` checks the membership before inserting `II` anyway.
https://github.com/llvm/llvm-project/pull/109506
More information about the llvm-commits
mailing list