aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
authorOCHyams <orlando.hyams@sony.com>2020-08-27 09:40:50 +0100
committerOCHyams <orlando.hyams@sony.com>2020-08-27 11:52:29 +0100
commit0b5a8050ea39355a3876cc6bba9383d91e224e1f (patch)
tree20f802da70849d245359e2fc9f63ff3b661cde03 /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
parente048ea7b1a05793df86b931b43faeacf2ae7373d (diff)
downloadllvm-0b5a8050ea39355a3876cc6bba9383d91e224e1f.zip
llvm-0b5a8050ea39355a3876cc6bba9383d91e224e1f.tar.gz
llvm-0b5a8050ea39355a3876cc6bba9383d91e224e1f.tar.bz2
[DwarfDebug] Improve single location detection in validThroughout (2/4)
With this patch we're now accounting for two more cases which should be considered 'valid throughout': First, where RangeEnd is ScopeEnd. Second, where RangeEnd comes before ScopeEnd when including meta instructions, but are both preceded by the same non-meta instruction. CTMark shows a geomean binary size reduction of 1.5% for RelWithDebInfo builds. `llvm-locstats` (using D85636) shows a very small variable location coverage change in 2 of 10 binaries, but it is in the order of 10s of bytes which lines up with my expectations. I've added a test which checks both of these new cases. The first check in the test isn't strictly necessary for this patch. But I'm not sure that it is explicitly tested anywhere else, and is useful for the final patch in the series. Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D86151
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index a46de83..9693248 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -196,8 +196,9 @@ void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
assert(DbgLabels.empty() && "DbgLabels map wasn't cleaned!");
calculateDbgEntityHistory(MF, Asm->MF->getSubtarget().getRegisterInfo(),
DbgValues, DbgLabels);
+ InstOrdering.initialize(*MF);
if (TrimVarLocs)
- DbgValues.trimLocationRanges(*MF, LScopes);
+ DbgValues.trimLocationRanges(*MF, LScopes, InstOrdering);
LLVM_DEBUG(DbgValues.dump());
// Request labels for the full history.
@@ -333,6 +334,7 @@ void DebugHandlerBase::endFunction(const MachineFunction *MF) {
DbgLabels.clear();
LabelsBeforeInsn.clear();
LabelsAfterInsn.clear();
+ InstOrdering.clear();
}
void DebugHandlerBase::beginBasicBlock(const MachineBasicBlock &MBB) {