[DebugInfo] Correctly track SDNode dependencies for list debug values
commite10493eb5012a2c313471489646bde9595ea06c0
authorStephen Tozer <Stephen.Tozer@Sony.com>
Fri, 26 Mar 2021 14:52:56 +0000 (26 14:52 +0000)
committerStephen Tozer <Stephen.Tozer@Sony.com>
Thu, 8 Apr 2021 16:01:45 +0000 (8 17:01 +0100)
tree31ea219d6fe1d0e92a367d2c69a8b10bef824c4d
parente184eeaa3ba124722684dcaece92e712f2484d9b
[DebugInfo] Correctly track SDNode dependencies for list debug values

During SelectionDAG, we must track the SDNodes that each SDDbgValue depends on
to compute its value. These are ultimately derived from the location operands to
the SDDbgValue, but were stored in a separate vector prior to this patch. This
resulted in cases where one of the lists was updated incorrectly, resulting in
crashes during compilation. This patch fixes the issue by directly recomputing
the dependency list from the SDDbgOperands in getDependencies().

Differential Revision: https://reviews.llvm.org/D99423
llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/X86/dbg-list-dependencies.ll [new file with mode: 0644]