Intern all RecTy subclass instances to avoid duplicates.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 18 Jul 2011 17:02:57 +0000 (17:02 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 18 Jul 2011 17:02:57 +0000 (17:02 +0000)
commit77f8274c7d4bfb5e2a449eb49dc78dcae37e5457
tree49292d4e5c83d913536a8d3021e83d965a6e5c4b
parent22e522e08640be459f237796009cf7666d6d75e7
Intern all RecTy subclass instances to avoid duplicates.

Make all of the RecTy constructors private, and use get() factory
methods instead. Return singleton instances when it makes sense.

ListTy instance pointers are stored in the element RecTy instance.

BitsRecTy instance pointers, one per length, are stored in a static vector.

Also unique DefInit instances. A Record has a unique DefInit which
has a unique RecordRecTy instance.

This saves some 200k-300k RecTy allocations when parsing ARM.td. It
reduces TableGen's heap usage by almost 50%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135399 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/CodeGenDAGPatterns.cpp
utils/TableGen/CodeGenRegisters.cpp
utils/TableGen/Record.cpp
utils/TableGen/Record.h
utils/TableGen/TGParser.cpp
utils/TableGen/TGParser.h