[DebugInfo] Correctly update debug users of SSA values in tail duplication
authorStephen Tozer <Stephen.Tozer@Sony.com>
Mon, 26 Jul 2021 08:59:20 +0000 (09:59 +0100)
committerStephen Tozer <Stephen.Tozer@Sony.com>
Mon, 26 Jul 2021 16:27:57 +0000 (17:27 +0100)
commit31e75512174e1bdaa242ee5c7f30fe56e68c3748
tree692fd51cba365db2f802c774d2808c62bbc25125
parent240dde948252ab9ef0428c46ca578c06127d3799
[DebugInfo] Correctly update debug users of SSA values in tail duplication

During tail duplication, SSA values may be updated and have their uses
replaced with a virtual register, and any debug instructions that use
that value are deleted. This patch fixes the implementation of the debug
instruction deletion to work correctly for debug instructions that use
the SSA value multiple times, by batching deletions so that we don't
attempt to delete the same instruction twice.

Differential Revision: https://reviews.llvm.org/D106557
llvm/lib/CodeGen/TailDuplicator.cpp
llvm/test/CodeGen/X86/tail-dup-debugvalue.mir [new file with mode: 0644]