diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-06-12 17:48:18 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-06-12 17:48:18 +0000 |
commit | b676b01b84584130d8ed290e690511baff4c3cb2 (patch) | |
tree | c40ca524436e4ec730358bafc527fa58aa462bbd /llvm/lib/Bitcode | |
parent | c91fda3b10d42bdc585b188208bb60caefc399fb (diff) | |
download | bcm5719-llvm-b676b01b84584130d8ed290e690511baff4c3cb2.tar.gz bcm5719-llvm-b676b01b84584130d8ed290e690511baff4c3cb2.zip |
Move OperandList to be allocated prior to User for hung off subclasses.
For hung off uses, we need a Use* to tell use where the operands are.
This was User::OperandList but we want to remove that to save space
of all subclasses which aren't making use of 'hung off uses'.
Hung off uses now allocate their own 'OperandList' Use* in the
User::new which they call.
getOperandList() now uses the hung off uses bit to work out where the
Use* for the OperandList lives. If a User has hung off uses, then this
bit tells them to go back a single Use* from the User* and use that
value as the OperandList.
If a User has no hung off uses, then we get the first operand by
subtracting (NumOperands * sizeof(Use)) from the User this pointer.
This saves a pointer from User and all subclasses. Given the average
size of a subclass of User is 112 or 128 bytes, this saves around 7% of space
With malloc tending to align to 16-bytes the real saving is typically more like 3.5%.
On 'opt -O2 verify-uselistorder.lto.bc', peak memory usage prior to this change
is 149MB and after is 143MB so the savings are around 2.5% of peak.
Looking at some passes which allocate many Instructions and Values, parseIR drops
from 54.25MB to 52.21MB while the Inliner calls to Instruction::clone() drops
from 28.20MB to 27.05MB.
Reviewed by Duncan Exon Smith.
llvm-svn: 239623
Diffstat (limited to 'llvm/lib/Bitcode')
0 files changed, 0 insertions, 0 deletions