[PATCH] Move the name pointer off of Value

Owen Anderson resistor at mac.com
Mon Jun 1 14:59:49 PDT 2015


Hi pete, chandlerc,

Move the name pointer out of Value into a map that lives on LLVMContext.  Production builds of clang do not set names on 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).

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10173

Files:
  include/llvm/IR/Value.h
  lib/IR/LLVMContextImpl.h
  lib/IR/Metadata.cpp
  lib/IR/Value.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10173.26934.patch
Type: text/x-patch
Size: 5495 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150601/23fa0480/attachment.bin>


More information about the llvm-commits mailing list