When the lattice value of a value is overdefined, LazyValueInfoCache inserts the lattice value into LazyValueInfoCache::ValueCache in addition to inserting it into OverDefinedCache. This isn't necessary and causes LazyValueInfo to use an excessive amount of memory in some cases.
This patch attempts to reduce memory usage of LazyValueInfo by avoiding inserting entries into LazyValueInfoCache::ValueCache when the lattice value type is overdefined. The memory usage decreases by 70 to 75% (from 1.5GB to 400MB) when I build one of the files in llvm.