[DebugInfo] Treat empty metadata operands the same as undef operands
A `ValueAsMetadata` may be replaced with nullptr for several reasons including deleting values and value remapping a use-before-def. In the case of a `MetadataAsValue` user, `handleChangedOperand` intercepts and replaces the metadata with an empty tuple (`!{}`). At the moment, an empty metadata operand in a debug intrinsics signals that it can be deleted. Given that we end up with empty metadata operands in circumstances where the Value has been "lost" the current behaviour can lead to incorrect variable locations. Instead, we should treat empty metadata as meaning "there is no location for the variable" (the same as we currently treat undef operands). This patch changes `isKillLocation` to take this into account. Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value Reviewed By: StephenTozer Differential Revision: https://reviews.llvm.org/D140902
Loading
Please sign in to comment