[AVX] Make IntInit Unique

Use a DenseMap to make sure only one IntInit of any value exists.

llvm-svn: 136490
This commit is contained in:
David Greene 2011-07-29 19:07:12 +00:00
parent a527d6a682
commit b6f328122b

View File

@ -539,7 +539,12 @@ const Init *BitsInit::resolveReferences(Record &R, const RecordVal *RV) const {
}
const IntInit *IntInit::get(int64_t V) {
return new IntInit(V);
typedef DenseMap<int64_t, IntInit *> Pool;
static Pool ThePool;
IntInit *&I = ThePool[V];
if (!I) I = new IntInit(V);
return I;
}
std::string IntInit::getAsString() const {