[all-commits] [llvm/llvm-project] b002b3: [DebugInfo][RemoveDIs] Add new behind-the-scenes p...
Jeremy Morse via All-commits
all-commits at lists.llvm.org
Thu Nov 9 07:34:11 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b002b38fd9f9bd66c7364eb4e9d639da9a5a66c7
https://github.com/llvm/llvm-project/commit/b002b38fd9f9bd66c7364eb4e9d639da9a5a66c7
Author: Jeremy Morse <jeremy.morse at sony.com>
Date: 2023-11-09 (Thu, 09 Nov 2023)
Changed paths:
M llvm/include/llvm/IR/BasicBlock.h
M llvm/include/llvm/IR/Instruction.h
M llvm/lib/IR/BasicBlock.cpp
M llvm/lib/IR/DebugProgramInstruction.cpp
M llvm/lib/IR/Instruction.cpp
A llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
M llvm/unittests/IR/CMakeLists.txt
Log Message:
-----------
[DebugInfo][RemoveDIs] Add new behind-the-scenes plumbing for debug-info
This is the "central" patch to the removing-debug-intrinsics project: it
changes the instruction movement APIs (insert, move, splice) to interpret
the "Head" bits we're attaching to BasicBlock::iterators, and updates
debug-info records in the background to preserve the ordering of debug-info
(which is in DPValue objects instead of dbg.values). The cost is the
complexity of this patch, plus memory. The benefit is that LLVM developers
can cease thinking about whether they're moving debug-info or not, because
it'll happen behind the scenes.
All that complexity appears in BasicBlock::spliceDebugInfo, see the diagram
there for how we now manually shuffle debug-info around. Each potential
splice configuration gets tested in the added unit tests.
The rest of this patch applies the same reasoning in a variety of
scenarios. When moveBefore (and it's siblings) are used to move
instructions around, the caller has to indicate whether they intend for
debug-info to move too (is it a "Preserving" call or not), and then the
"Head" bits used to determine where debug-info moves to. Similar reasoning
is needed for insertBefore.
Differential Revision: https://reviews.llvm.org/D154353
More information about the All-commits
mailing list