[llvm] d224a03 - [SCEV] Use insert_or_assign() (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 00:30:14 PDT 2024


Author: Nikita Popov
Date: 2024-06-07T09:30:06+02:00
New Revision: d224a034a20016272a3257f7081d02f90eb9cc78

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

LOG: [SCEV] Use insert_or_assign() (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/ScalarEvolution.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index 72f3d94542496..b273d118c4c76 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -1656,9 +1656,7 @@ class ScalarEvolution {
     DenseMap<const SCEV *, ConstantRange> &Cache =
         Hint == HINT_RANGE_UNSIGNED ? UnsignedRanges : SignedRanges;
 
-    auto Pair = Cache.try_emplace(S, std::move(CR));
-    if (!Pair.second)
-      Pair.first->second = std::move(CR);
+    auto Pair = Cache.insert_or_assign(S, std::move(CR));
     return Pair.first->second;
   }
 


        


More information about the llvm-commits mailing list