forked from OSchip/llvm-project
c73c0307fe
a generically extensible collection of extra info attached to a `MachineInstr`. The primary change here is cleaning up the APIs used for setting and manipulating the `MachineMemOperand` pointer arrays so chat we can change how they are allocated. Then we introduce an extra info object that using the trailing object pattern to attach some number of MMOs but also other extra info. The design of this is specifically so that this extra info has a fixed necessary cost (the header tracking what extra info is included) and everything else can be tail allocated. This pattern works especially well with a `BumpPtrAllocator` which we use here. I've also added the basic scaffolding for putting interesting pointers into this, namely pre- and post-instruction symbols. These aren't used anywhere yet, they're just there to ensure I've actually gotten the data structure types correct. I'll flesh out support for these in a subsequent patch (MIR dumping, parsing, the works). Finally, I've included an optimization where we store any single pointer inline in the `MachineInstr` to avoid the allocation overhead. This is expected to be the overwhelmingly most common case and so should avoid any memory usage growth due to slightly less clever / dense allocation when dealing with >1 MMO. This did require several ergonomic improvements to the `PointerSumType` to reasonably support the various usage models. This also has a side effect of freeing up 8 bits within the `MachineInstr` which could be repurposed for something else. The suggested direction here came largely from Hal Finkel. I hope it was worth it. ;] It does hopefully clear a path for subsequent extensions w/o nearly as much leg work. Lots of thanks to Reid and Justin for careful reviews and ideas about how to do all of this. Differential Revision: https://reviews.llvm.org/D50701 llvm-svn: 339940 |
||
---|---|---|
.. | ||
AsmParser | ||
Disassembler | ||
InstPrinter | ||
MCTargetDesc | ||
TargetInfo | ||
CMakeLists.txt | ||
LLVMBuild.txt | ||
Lanai.h | ||
Lanai.td | ||
LanaiAluCode.h | ||
LanaiAsmPrinter.cpp | ||
LanaiCallingConv.td | ||
LanaiCondCode.h | ||
LanaiDelaySlotFiller.cpp | ||
LanaiFrameLowering.cpp | ||
LanaiFrameLowering.h | ||
LanaiISelDAGToDAG.cpp | ||
LanaiISelLowering.cpp | ||
LanaiISelLowering.h | ||
LanaiInstrFormats.td | ||
LanaiInstrInfo.cpp | ||
LanaiInstrInfo.h | ||
LanaiInstrInfo.td | ||
LanaiMCInstLower.cpp | ||
LanaiMCInstLower.h | ||
LanaiMachineFunctionInfo.cpp | ||
LanaiMachineFunctionInfo.h | ||
LanaiMemAluCombiner.cpp | ||
LanaiRegisterInfo.cpp | ||
LanaiRegisterInfo.h | ||
LanaiRegisterInfo.td | ||
LanaiSchedule.td | ||
LanaiSelectionDAGInfo.cpp | ||
LanaiSelectionDAGInfo.h | ||
LanaiSubtarget.cpp | ||
LanaiSubtarget.h | ||
LanaiTargetMachine.cpp | ||
LanaiTargetMachine.h | ||
LanaiTargetObjectFile.cpp | ||
LanaiTargetObjectFile.h | ||
LanaiTargetTransformInfo.h |