[PATCH] D28150: Move the section name from GlobalObject to the LLVMContext

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 18:05:26 PST 2016


rnk created this revision.
rnk added reviewers: jlebar, dexonsmith.
rnk added a subscriber: llvm-commits.
Herald added a subscriber: aprantl.

Convention wisdom says that bytes in Function are precious, and the
vast, vast majority of globals do not live in special sections. Even
when they do, they tend to live in the same section. Store the section
name on the LLVMContext in a StringSet, and maintain a map from
GlobalObject* to section name like we do for metadata, prefix data, etc.

The fact that we've survived this long wasting at least three pointers
of space in Function suggests that Function bytes are perhaps not as
precious as we once thought. Given that most functions have metadata
attachments when debug info is enabled, we might consider adding a
pointer here to make that access more efficient.


https://reviews.llvm.org/D28150

Files:
  include/llvm/IR/GlobalObject.h
  lib/IR/Globals.cpp
  lib/IR/LLVMContextImpl.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28150.82640.patch
Type: text/x-patch
Size: 4030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161229/923da754/attachment.bin>


More information about the llvm-commits mailing list