[IR] Teach `llvm::User` to co-allocate a descriptor.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 24 Sep 2015 01:00:49 +0000 (01:00 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 24 Sep 2015 01:00:49 +0000 (01:00 +0000)
commit4769a7486b277ecdcf30e66d63de1d809c594af0
tree99a9598844540c639479d247f216085a40feaffc
parentd4d53a507caba8d3a94e5c4c1e9bc325639e49ad
[IR] Teach `llvm::User` to co-allocate a descriptor.

Summary:
With this change, subclasses of `llvm::User` will be able to co-allocate
a variable number of bytes (called a "descriptor") with the `llvm::User`
instance.  The co-allocated descriptor can later be accessed using
`llvm::User::getDescriptor`.  This will be used in later changes to
implement operand bundles.

This change steals one bit from `NumUserOperands`, but given that it is
still 28 bits wide I don't think this will be a practical issue.

This change does not allow allocating hung off uses with descriptors.
This only for simplicity, not for any fundamental reason; and we can
easily add this functionality later if needed.

Reviewers: reames, chandlerc, dexonsmith, kmod, majnemer, pete, JosephTremoulet

Subscribers: pete, sanjoy, llvm-commits

Differential Revision: http://reviews.llvm.org/D12455

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