This is an archive of the discontinued LLVM Phabricator instance.

Don't replace Undef with null value for Constants
ClosedPublic

Authored by ykhatav on Apr 20 2022, 8:59 AM.

Details

Summary

The following patch - (https://reviews.llvm.org/D117300) introduced null's into the debug information and those nulls are expected to be undef values. The RAUW debug info handlers are for instructions, not constants and the debug information expects the value to be undef and not null. This patch tries to fix this behavior by not replacing undef with null value in Constants for debug info metadata.

Diff Detail

Event Timeline

ykhatav created this revision.Apr 20 2022, 8:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 8:59 AM
ykhatav requested review of this revision.Apr 20 2022, 8:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 8:59 AM
ychen added a subscriber: ychen.Apr 20 2022, 10:30 AM
bwyma added a comment.Apr 22 2022, 7:33 AM

In a similar fashion to how instructions are handled according to Delete an IR-level instruction, when a constant is destroyed and cannot be RAUW'd, updating the debug information uses of the constant to undef seems like the correct approach. LGTM.

StephenTozer accepted this revision.Apr 25 2022, 7:36 AM

Good fix, LGTM.

llvm/test/DebugInfo/X86/undef-type-md.ll
21

Nit, can this attribute be removed?

This revision is now accepted and ready to land.Apr 25 2022, 7:36 AM
ykhatav updated this revision to Diff 424927.Apr 25 2022, 9:13 AM

Removed the attribute

ykhatav updated this revision to Diff 424940.Apr 25 2022, 9:33 AM
fhahn closed this revision.Apr 26 2022, 4:00 AM
fhahn added a subscriber: fhahn.

Looks like this was submitted as e83543f8c2ef

@ykhatav it looks like it wasn't closed automatically because the commit message was all one line. Please make sure the commit message is properly structured in the future.