llvm-6502/include/llvm
Pete Cooper a6ff22119f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239623 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-12 17:48:18 +00:00
..
ADT Add missing #include, found by modules build. 2015-06-12 02:13:45 +00:00
Analysis [LAA] Fix estimation of number of memchecks 2015-06-08 10:27:06 +00:00
AsmParser
Bitcode
CodeGen [WinEH] Create an llvm.x86.seh.exceptioninfo intrinsic 2015-06-11 22:32:23 +00:00
Config
DebugInfo Re-unique_ptrify LoadedObjectInfo::clone after it was reverted due to some other changes that broke on GCC around the same time 2015-06-04 20:54:32 +00:00
ExecutionEngine [Orc] Attempted fix for GCC ICE on Polly builder. 2015-06-11 22:51:01 +00:00
IR Move OperandList to be allocated prior to User for hung off subclasses. 2015-06-12 17:48:18 +00:00
IRReader
LibDriver LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
LineEditor
Linker
LTO Make the C++ LTO API easier to use from C++ clients. 2015-06-01 20:08:30 +00:00
MC MC: Prune \return corresponding to r239552. [-Wdocumentation] 2015-06-11 23:04:56 +00:00
Object Have the ELF symbol predicates match more directly the spec. 2015-06-12 17:23:39 +00:00
Option
Passes
ProfileData
Support Replace string GNU Triples with llvm::Triple in TargetMachine. NFC. 2015-06-11 19:41:26 +00:00
TableGen [TableGen] Use the SMLoc header file instead of SourceMgr header file in a couple places. NFC 2015-06-08 01:35:40 +00:00
Target Replace string GNU Triples with llvm::Triple in TargetMachine. NFC. 2015-06-11 19:41:26 +00:00
Transforms Revert commit r239480 as it causes https://code.google.com/p/chromium/issues/detail?id=499508#c3. 2015-06-12 03:12:00 +00:00
CMakeLists.txt
InitializePasses.h Revert commit r239480 as it causes https://code.google.com/p/chromium/issues/detail?id=499508#c3. 2015-06-12 03:12:00 +00:00
LinkAllIR.h
LinkAllPasses.h [NFC] added a missing space 2015-06-10 22:54:02 +00:00
module.modulemap
module.modulemap.build
Pass.h
PassAnalysisSupport.h
PassInfo.h
PassRegistry.h
PassSupport.h