Move the name pointer out of Value into a map that lives on the
authorOwen Anderson <resistor@mac.com>
Mon, 1 Jun 2015 22:24:01 +0000 (22:24 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 1 Jun 2015 22:24:01 +0000 (22:24 +0000)
commitbd84bdb2bebb9cdf4bdf03a9f2041c7a64da2552
tree3ad0c7970c54444e9c0c0d811f55a4ecb707383f
parenta116a41be0ab900f95371300e197c2b5df50527d
Move the name pointer out of Value into a map that lives on the
LLVMContext.  Production builds of clang do not set names on most
Value's, so this is wasted space on almost all subclasses of Value.
This reduces the size of all Value subclasses by 8 bytes on 64 bit
hosts.

The one tricky part of this change is averting compile time regression
by keeping Value::hasName() fast.  This required stealing bits out of
NumOperands.

With this change, peak memory usage on verify-uselistorder-nodbg.lto.bc
is decreased by approximately 2.3% (~3MB absolute on my machine).

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