OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
726bbde
)
[AVX] Make IntInit Unique
author
David Greene
<greened@obbligato.org>
Fri, 29 Jul 2011 19:07:12 +0000
(19:07 +0000)
committer
David Greene
<greened@obbligato.org>
Fri, 29 Jul 2011 19:07:12 +0000
(19:07 +0000)
Use a DenseMap to make sure only one IntInit of any value exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136490
91177308
-0d34-0410-b5e6-
96231b3b80d8
utils/TableGen/Record.cpp
patch
|
blob
|
history
diff --git
a/utils/TableGen/Record.cpp
b/utils/TableGen/Record.cpp
index
77c0d1a
..
54edfe5
100644
(file)
--- a/
utils/TableGen/Record.cpp
+++ b/
utils/TableGen/Record.cpp
@@
-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 {