[llvm] [Analysis] Simplify code with DenseMap::operator[] (NFC) (PR #112082)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 23:09:27 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) llvm/lib/Analysis/AssumptionCache.cpp (+1-3) 


``````````diff
diff --git a/llvm/lib/Analysis/AssumptionCache.cpp b/llvm/lib/Analysis/AssumptionCache.cpp
index 9c86ef13f6df03..a0e57ab741dfa8 100644
--- a/llvm/lib/Analysis/AssumptionCache.cpp
+++ b/llvm/lib/Analysis/AssumptionCache.cpp
@@ -50,9 +50,7 @@ AssumptionCache::getOrInsertAffectedValues(Value *V) {
   if (AVI != AffectedValues.end())
     return AVI->second;
 
-  auto AVIP = AffectedValues.insert(
-      {AffectedValueCallbackVH(V, this), SmallVector<ResultElem, 1>()});
-  return AVIP.first->second;
+  return AffectedValues[AffectedValueCallbackVH(V, this)];
 }
 
 static void

``````````

</details>


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


More information about the llvm-commits mailing list