This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Do not replace Instruction uses with undef
AcceptedPublic

Authored by Orlando on Jan 5 2023, 8:50 AM.

Details

Summary

The patch series that contains D140901 changes empty metadata operands (!{}) to mean the same thing as undef in debug intrinsics. Therefore, we no longer need this code which performs a RAUW(this, undef/poison) on deletion.

Deleting an Instruction with debug uses will now result in the same behaviour as non-Instruction Values. First, ValueAsMetadata::handleDeletion will RAUW(nullptr). For single-operand debug intrinsics MatadataAsValue::handleChangedMetadata converts that to an empty tuple !{}. For variadic debug intrinsics uses DIArgList::handleChangedOperand converts that to poison.

Note that even if we didn't make this change, we'd still need to update the use of undef to poison at some point - so the tests are going to need updating all the same.

Diff Detail