[llvm] [SPIRV] Avoid repeated hash lookups (NFC) (PR #126854)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 21:03:25 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-spir-v

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/126854.diff


1 Files Affected:

- (modified) llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
index 719abde3d7fa6..4f3cc9ada04cf 100644
--- a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
@@ -93,7 +93,7 @@ class SPIRVEmitIntrinsics
   void eraseTodoType(Value *Op) {
     auto It = TodoType.find(Op);
     if (It != TodoType.end() && It->second) {
-      TodoType[Op] = false;
+      It->second = false;
       --TodoTypeSz;
     }
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/126854


More information about the llvm-commits mailing list