[Assignment Tracking] Improve removeRedundantDbgLocsUsingBackwardScan
authorOCHyams <orlando.hyams@sony.com>
Wed, 29 Mar 2023 13:27:16 +0000 (14:27 +0100)
committerOCHyams <orlando.hyams@sony.com>
Wed, 29 Mar 2023 14:59:46 +0000 (15:59 +0100)
commit8e56a196fb5c26e556ac267986868a3f63b7c486
tree12e2bd2bfb9822c639761b0d0741c1e7d9051c86
parent28858d5902f84ab760c8531061d43539e2135ae1
[Assignment Tracking] Improve removeRedundantDbgLocsUsingBackwardScan

`removeRedundantDbgLocsUsingBackwardScan` removes redundant dbg loc definitions
by scanning backwards through contiguous sets of them (a "wedge"), removing
earlier (in IR order terms) defs for fragments of variables that are defined
later in the wedge.

In this patch we use a `Bitvector` for each variable to track which bits have
definitions to more accurately determine whether a loc def is redundant. This
patch increases compile time by itself, but reduces it when combined with the
follow-up patch.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D146978
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
llvm/test/DebugInfo/assignment-tracking/X86/nested-loop-frags.ll
llvm/test/DebugInfo/assignment-tracking/X86/remove-redundant-defs-bwd-scan.ll [new file with mode: 0644]
llvm/test/DebugInfo/assignment-tracking/X86/untagged-store-frag.ll