fix compile-time regression report by Joerg Sonnenberger:

cache result of Size/OffsetVisitor to speedup analysis of PHI nodes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172363 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nuno Lopes
2013-01-13 18:02:57 +00:00
parent 135174deb8
commit 29eb2cc00c
2 changed files with 13 additions and 9 deletions

View File

@ -153,12 +153,14 @@ typedef std::pair<APInt, APInt> SizeOffsetType;
class ObjectSizeOffsetVisitor
: public InstVisitor<ObjectSizeOffsetVisitor, SizeOffsetType> {
typedef DenseMap<const Value*, SizeOffsetType> CacheMapTy;
const DataLayout *TD;
const TargetLibraryInfo *TLI;
bool RoundToAlign;
unsigned IntTyBits;
APInt Zero;
SmallPtrSet<Value*, 8> SeenInsts;
CacheMapTy CacheMap;
APInt align(APInt Size, uint64_t Align);