diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2021-10-22 19:10:05 +0100 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2021-10-22 19:20:55 +0100 |
commit | e7084ceab31223a0d983996d61c24486032b537b (patch) | |
tree | b2a809efcc8be976c72deb642c70d1149200e07f /llvm/unittests/Support/ErrorTest.cpp | |
parent | b03628d986d47e41187278acd2e2b66dd3dc03ae (diff) | |
download | llvm-e7084ceab31223a0d983996d61c24486032b537b.zip llvm-e7084ceab31223a0d983996d61c24486032b537b.tar.gz llvm-e7084ceab31223a0d983996d61c24486032b537b.tar.bz2 |
[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
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
0 files changed, 0 insertions, 0 deletions