Changes in LoopUnroll in the past six months exposed scalability
issues in LazyValueInfo when used from JumpThreading. One internal test
that used to take 20s under -O2 now takes 6min.
This patch makes a couple of changes to speed-up LazyValueInfo and
reduces compile time to 1m20s.
- Change the OverDefinedCache from
DenseSet<std::pair<AssertingVH<BasicBlock>, Value*>>
to
DenseMap<AssertingVH<BasicBlock>, SmallPtrSet<Value *, 4>>
- Use DenseMap instead of std::map for ValueCacheEntryTy. Historically
there seems to be some resistance regarding the change to DenseMap
(r147980), but I couldn't find cases of iterator invalidation for
ValueCacheEntryTy (only for ValueCache, but this one is left unchanged
- still using std::map).