[DebugInfo] Track multiple registers in DbgEntityHistoryCalculator

Authored by dstenb on Apr 10 2019, 4:28 AM.


[DebugInfo] Track multiple registers in DbgEntityHistoryCalculator

When calculating the debug value history, DbgEntityHistoryCalculator
would only keep track of register clobbering for the latest debug value
per inlined entity. This meant that preceding register-described debug
value fragments would live on until the next overlapping debug value,
ignoring any potential clobbering. This patch amends
DbgEntityHistoryCalculator so that it keeps track of all registers that
a inlined entity's currently live debug values are described by.

The DebugInfo/COFF/pieces.ll test case has had to be changed since
previously a register-described fragment would incorrectly outlive its
basic block.

The parent patch D59941 is expected to increase the coverage slightly,
as it makes sure that location list entries are inserted after clobbered
fragments, and this patch is expected to decrease it, as it stops
preceding register-described from living longer than they should. All in
all, this patch and the preceding patch has a negligible effect on the
output from `llvm-dwarfdump -statistics' for a clang-3.4 binary built
using the RelWithDebInfo build profile. "Scope bytes covered" increases
by 0.5%, and "variables with location" increases from 2212083 to
2212088, but it should improve the accuracy quite a bit.

This fixes PR40283.

Reviewers: aprantl, probinson, dblaikie, rnk, bjope

Reviewed By: aprantl

Subscribers: llvm-commits

Tags: debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D59942

llvm-svn: 358073


dstenbApr 10 2019, 4:28 AM
Differential Revision
D59942: [DebugInfo] Track multiple registers in DbgEntityHistoryCalculator
rG5ffec6deef0a: [DebugInfo] Improve handling of clobbered fragments