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

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 12 08:04:41 PDT 2024


Author: Kazu Hirata
Date: 2024-10-12T08:04:38-07:00
New Revision: c9a1cffd3d2129ccdda766ef4379dbca1cf6724b

URL: https://github.com/llvm/llvm-project/commit/c9a1cffd3d2129ccdda766ef4379dbca1cf6724b
DIFF: https://github.com/llvm/llvm-project/commit/c9a1cffd3d2129ccdda766ef4379dbca1cf6724b.diff

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

Added: 
    

Modified: 
    llvm/lib/Analysis/AssumptionCache.cpp

Removed: 
    


################################################################################
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


        


More information about the llvm-commits mailing list