llvm-project/llvm/unittests/CodeGen
Jeremy Morse e7084ceab3 [DebugInfo][Instr] Track subregisters across stack spills/restores
Sometimes we generate code that writes to a subregister, then spills /
restores a super-register to the stack, for example:

    $eax = MOV32ri 0
    MOV64mr $rsp, 1, $noreg, 16, $noreg, $rax
    $rcx = MOV64rm $rsp, 1, $noreg, 8, $noreg

This patch takes a different approach: it adds another index to
MLocTracker that identifies a size/offset within a stack slot. A location
on the stack is then a pari of {FrameIndex, SlotNum}. Spilling and
restoring now involves pairing up the src/dest register numbers, and the
dest/src stack position to be transferred to/from. Location coverage
improves as a result, compile-time performance decreases, alas.

One limitation is that if a PHI occurs inside a stack slot:

    DBG_PHI %stack.0, 1

We don't know how large the resulting value is, and so might have
difficulty picking which value to use. DBG_PHI might need to be augmented
in the future with such a size.

Unit tests added ensure that spills and restores correctly transfer to
positions in the Location => Value map, and that different register classes
written to the stack will correctly clobber all other positions in the
stack slot.

Differential Revision: https://reviews.llvm.org/D112133
2021-10-22 19:20:55 +01:00
..
GlobalISel Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
AArch64SelectionDAGTest.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
AllocationOrderTest.cpp [NFC][regalloc] Separate iteration from AllocationOrder 2020-10-05 16:13:18 -07:00
AsmPrinterDwarfTest.cpp [unittests][CodeGen] Mark tests that cannot be executed with GTEST_SKIP() 2021-05-21 13:39:52 +07:00
CMakeLists.txt [DebugInfo][NFC] Move LiveDebugValues class to header 2021-10-12 16:07:26 +01:00
DIEHashTest.cpp [unittests][CodeGen] Mark tests that cannot be executed with GTEST_SKIP() 2021-05-21 13:39:52 +07:00
DIETest.cpp [unittests][CodeGen] Mark tests that cannot be executed with GTEST_SKIP() 2021-05-21 13:39:52 +07:00
InstrRefLDVTest.cpp [DebugInfo][Instr] Track subregisters across stack spills/restores 2021-10-22 19:20:55 +01:00
LexicalScopesTest.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
LowLevelTypeTest.cpp Add support for zero-sized Scalars as a LowLevelType 2021-07-22 13:47:19 +02:00
MFCommon.inc [X86][MC][Target] Initial backend support a tune CPU to support -mtune 2020-08-14 15:31:50 -07:00
MachineInstrBundleIteratorTest.cpp
MachineInstrTest.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
MachineOperandTest.cpp [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
PassManagerTest.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
ScalableVectorMVTsTest.cpp [llvm] Add enum iteration to Sequence 2021-07-21 12:48:53 +00:00
SelectionDAGAddressAnalysisTest.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
TargetOptionsTest.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
TestAsmPrinter.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
TestAsmPrinter.h [debug-info] refactor emitDwarfUnitLength 2021-02-25 21:00:25 -05:00
TypeTraitsTest.cpp Switch from llvm::is_trivially_copyable to std::is_trivially_copyable 2020-12-02 22:02:48 -08:00