[llvm] [LV] Prefer DenseMap::lookup over find (NFC) (PR #141809)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 07:01:08 PDT 2025


================
@@ -2566,9 +2566,9 @@ static Value *getExpandedStep(const InductionDescriptor &ID,
     return C->getValue();
   if (auto *U = dyn_cast<SCEVUnknown>(Step))
     return U->getValue();
-  auto I = ExpandedSCEVs.find(Step);
-  assert(I != ExpandedSCEVs.end() && "SCEV must be expanded at this point");
-  return I->second;
+  auto *V = ExpandedSCEVs.lookup(Step);
----------------
fhahn wrote:

```suggestion
   Value *V = ExpandedSCEVs.lookup(Step);
```

now we can spell out the simple type

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


More information about the llvm-commits mailing list