Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 25, 2025

@llvm/pr-subscribers-llvm-globalisel

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp (+3-2)
diff --git a/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
index 9841c8ae1ffb2..05923e5fc97cc 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
@@ -308,9 +308,10 @@ LegacyLegalizerInfo::findScalarLegalAction(const InstrAspect &Aspect) const {
   ArrayRef<SizeAndActionsVec> Actions;
   if (Aspect.Type.isPointer()) {
     auto &PA = AddrSpace2PointerActions[OpcodeIdx];
-    if (PA.find(Aspect.Type.getAddressSpace()) == PA.end())
+    auto It = PA.find(Aspect.Type.getAddressSpace());
+    if (It == PA.end())
       return {NotFound, LLT()};
-    Actions = PA.find(Aspect.Type.getAddressSpace())->second;
+    Actions = It->second;
   } else {
     Actions = ScalarActions[OpcodeIdx];
   }

@kazutakahirata kazutakahirata merged commit 3083aea into llvm:main Feb 25, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_GlobalISel branch February 25, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants