summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-15 20:39:05 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-15 20:39:05 +0000
commit8d5aeb269869b66919864f93e706d054d142b29d (patch)
treea47c61cda8648d154571bf867fbe9f3056fa8e3e /llvm/lib/IR/Value.cpp
parentfcece4d2162e47c0f7325d1c262f460ff078aab7 (diff)
downloadbcm5719-llvm-8d5aeb269869b66919864f93e706d054d142b29d.tar.gz
bcm5719-llvm-8d5aeb269869b66919864f93e706d054d142b29d.zip
IR: Move NumOperands from User to Value, NFC
Store `User::NumOperands` (and `MDNode::NumOperands`) in `Value`. On 64-bit host architectures, this reduces `sizeof(User)` and all subclasses by 8, and has no effect on `sizeof(Value)` (or, incidentally, on `sizeof(MDNode)`). On 32-bit host architectures, this increases `sizeof(Value)` by 4. However, it has no effect on `sizeof(User)` and `sizeof(MDNode)`, so the only concrete subclasses of `Value` that actually see the increase are `BasicBlock`, `Argument`, `InlineAsm`, and `MDString`. Moreover, I'll be shocked and confused if this causes a tangible memory regression. This has no functionality change (other than memory footprint). llvm-svn: 219845
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index b5af72b858e..862f08c8966 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -45,7 +45,8 @@ static inline Type *checkType(Type *Ty) {
Value::Value(Type *ty, unsigned scid)
: VTy(checkType(ty)), UseList(nullptr), Name(nullptr), SubclassID(scid),
- HasValueHandle(0), SubclassOptionalData(0), SubclassData(0) {
+ HasValueHandle(0), SubclassOptionalData(0), SubclassData(0),
+ NumOperands(0) {
// FIXME: Why isn't this in the subclass gunk??
// Note, we cannot call isa<CallInst> before the CallInst has been
// constructed.
OpenPOWER on IntegriCloud