[llvm-commits] [PATCH] Reduce Certain ilist<>s by One Pointer

Gabor Greif gabor at mac.com
Wed Mar 4 15:59:15 PST 2009

Hi all,

here comes my last size-reduction patch for certain ilists,
namely those which have superposed ("ghostly") sentinels.

The theory behind this is that it is only legal to access the Prev
field of ilist sentinels (the operator-- does this) but nothing else.

When asserts are enabled, there is code that expects to see
NULL in sentinel->Next, so this patch is only active in
(Debug|Release)-Asserts builds. I check the NDEBUG
preprocessor symbol for this.

When in this mode, the sentinels only have a valid Prev field,
which reduces the sizes of following classes:

BasicBlock by 1 pointer
Function by 2 pointers
MachineBasicBlock by 1 pointer
MachineFunction by 1 pointer
SelectionDAG by 1 pointer.

I expect significant savings by the first three of those.

All dejagnu tests seem to pass, however I see a
Release-Asserts-related issue with missing -debug* options.
However this seems unrelated to the patch.

I am open for feedback,, esp. how to remove the macro
in ilist_node.h.

If feedback positive I plan to commit this in the next days.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: half-sentinel-node-0305.patch
Type: application/octet-stream
Size: 4807 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090305/e734d979/attachment.obj>
-------------- next part --------------

More information about the llvm-commits mailing list