[DebugInfo][SelectionDAG] Do not drop dbg intrinsics with empty metadata locs
authorOCHyams <orlando.hyams@sony.com>
Wed, 17 May 2023 17:15:57 +0000 (18:15 +0100)
committerOCHyams <orlando.hyams@sony.com>
Thu, 18 May 2023 09:08:37 +0000 (10:08 +0100)
commit6c088972d2822bd10e5104fd8994b5c25f3070e0
tree81fcd51d6c38d705743acab2143427f8e5f52e92
parent13bd96e43df14892cc6d9874d166447e6182d612
[DebugInfo][SelectionDAG] Do not drop dbg intrinsics with empty metadata locs

Without this patch SelectionDAG silently drops dbg.values using `!{}` operands.

Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value

This causes assignment-tracking to behaviour to match non-assignment-tracking
behaviour after a recent change (see D140990).

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D150767
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/DebugInfo/X86/dbg-empty-metadata-lowering.ll