[PATCH] D136321: [Assignment Tracking Analysis][2/*] Remove redundant location definitions

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 01:34:30 PDT 2022


Orlando created this revision.
Orlando added a project: debug-info.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Orlando requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Implement the `removeRedundantDbgInstrs` cleanup from `lib/Transforms/Utils/BasicBlockUtils.cpp` for `FunctionVarLocBuilder`'s variable location definitions.

Removing redundant entries has the obvious benefits of reducing peak memory when using the results of the analysis and reducing the final number of MIR debug instructions.

It also has a less obvious benefit. This patch is not an NFC change because SelectionDAG has a habit of doing Bad Things with variable locations - removing the number of location definitions tends to reduce the number of Bad Things.

Two examples I have seen:

1. Argument `SDDbgValue`s hoisted above undef ``SDDbgValue`s.
2. undef `SDDbgValue`s in a block of contiguous `SDDbgValue`s spuriously changing order.


https://reviews.llvm.org/D136321

Files:
  llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136321.469128.patch
Type: text/x-patch
Size: 7965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221020/536c174d/attachment.bin>


More information about the llvm-commits mailing list