llvm-project/llvm/lib/Target/Lanai
Chandler Carruth c73c0307fe [MI] Change the array of `MachineMemOperand` pointers to be
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
2018-08-16 21:30:05 +00:00
..
AsmParser Fix a bunch of places where operator-> was used directly on the return from dyn_cast. 2018-05-05 01:57:00 +00:00
Disassembler
InstPrinter
MCTargetDesc Fix MSVC '*/' found outside of comment warning. NFCI. 2018-06-06 11:10:11 +00:00
TargetInfo Remove some unneeded #includes to fix layering 2018-03-29 22:31:36 +00:00
CMakeLists.txt Consistently sort add_subdirectory calls in lib/Target/*/CMakeLists.txt 2018-04-23 12:49:34 +00:00
LLVMBuild.txt
Lanai.h
Lanai.td
LanaiAluCode.h
LanaiAsmPrinter.cpp
LanaiCallingConv.td
LanaiCondCode.h
LanaiDelaySlotFiller.cpp [DebugInfo] Examine all uses of isDebugValue() for debug instructions. 2018-05-09 02:42:00 +00:00
LanaiFrameLowering.cpp
LanaiFrameLowering.h Move TargetFrameLowering.h to CodeGen where it's implemented 2017-11-03 22:32:11 +00:00
LanaiISelDAGToDAG.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
LanaiISelLowering.cpp Remove SETCCE use from Lanai's backend 2018-06-03 12:56:24 +00:00
LanaiISelLowering.h Remove SETCCE use from Lanai's backend 2018-06-03 12:56:24 +00:00
LanaiInstrFormats.td [NFC] fix trivial typos in comments 2018-01-22 05:54:46 +00:00
LanaiInstrInfo.cpp [DebugInfo] Examine all uses of isDebugValue() for debug instructions. 2018-05-09 02:42:00 +00:00
LanaiInstrInfo.h Add LanaiMCTargetDesc.h to LanaiInstrInfo.h to make it self contained 2018-02-19 05:26:49 +00:00
LanaiInstrInfo.td [lanai] Handle atomic load of i8 like regular load. 2018-07-03 22:57:51 +00:00
LanaiMCInstLower.cpp
LanaiMCInstLower.h
LanaiMachineFunctionInfo.cpp
LanaiMachineFunctionInfo.h
LanaiMemAluCombiner.cpp [MI] Change the array of `MachineMemOperand` pointers to be 2018-08-16 21:30:05 +00:00
LanaiRegisterInfo.cpp Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering 2017-11-08 01:01:31 +00:00
LanaiRegisterInfo.h Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
LanaiRegisterInfo.td
LanaiSchedule.td
LanaiSelectionDAGInfo.cpp
LanaiSelectionDAGInfo.h
LanaiSubtarget.cpp
LanaiSubtarget.h Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
LanaiTargetMachine.cpp (Re-landing) Expose a TargetMachine::getTargetTransformInfo function 2017-12-22 18:21:59 +00:00
LanaiTargetMachine.h (Re-landing) Expose a TargetMachine::getTargetTransformInfo function 2017-12-22 18:21:59 +00:00
LanaiTargetObjectFile.cpp [Lanai] Code model dictates section selection. 2018-02-08 23:25:05 +00:00
LanaiTargetObjectFile.h
LanaiTargetTransformInfo.h Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00