IR: Move NumOperands from User to Value, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 15 Oct 2014 20:39:05 +0000 (20:39 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 15 Oct 2014 20:39:05 +0000 (20:39 +0000)
commit9ca230f11ccce9591941149d9cff0be326639c8a
treef584e002ad516649d8f61e285d8e11f4d5dfdfbe
parent40dd9d68d717c286d78bfe804ce73602f64b8d72
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219845 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Metadata.h
include/llvm/IR/User.h
include/llvm/IR/Value.h
lib/IR/Value.cpp