[llvm] r245314 - [LVI] Use a SmallDenseMap instead of std::map for ValueCacheEntryTy

Bruno Cardoso Lopes via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 09:54:36 PDT 2015


Author: bruno
Date: Tue Aug 18 11:54:36 2015
New Revision: 245314

URL: http://llvm.org/viewvc/llvm-project?rev=245314&view=rev
Log:
[LVI] Use a SmallDenseMap instead of std::map for ValueCacheEntryTy

Historically there seems to be some resistance regarding the change to DenseMap
(r147980). However, I couldn't find cases of iterator invalidation for
ValueCacheEntryTy, but only for ValueCache, which I left untouched.

This reduces 20s on an internal testcase. Follow up from r245309.

Differential Revision: http://reviews.llvm.org/D11651

rdar://problem/21320066

Modified:
    llvm/trunk/lib/Analysis/LazyValueInfo.cpp

Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=245314&r1=245313&r2=245314&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Tue Aug 18 11:54:36 2015
@@ -315,7 +315,8 @@ namespace {
     /// This is all of the cached block information for exactly one Value*.
     /// The entries are sorted by the BasicBlock* of the
     /// entries, allowing us to do a lookup with a binary search.
-    typedef std::map<AssertingVH<BasicBlock>, LVILatticeVal> ValueCacheEntryTy;
+    typedef SmallDenseMap<AssertingVH<BasicBlock>, LVILatticeVal, 4>
+        ValueCacheEntryTy;
 
     /// This is all of the cached information for all values,
     /// mapped from Value* to key information.




More information about the llvm-commits mailing list