This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVM] Use `undef` operand instead of removing `llvm.intr.dbg.value`
ClosedPublic

Authored by zero9178 on Jul 5 2023, 12:18 AM.

Details

Summary

Jeremy Morse noted in https://reviews.llvm.org/D154451 that LLVM doesn't drop a dbg.value when its value is being removed, but rather sets the operand to undef. This preserves the debug info and gives allows the debugger to instead inform the user that the variable has been optimized out, rather than not displaying the variable at all.

This patch fixes that mistake done in the previous revision by mirroring that behaviour in MLIR as well.

Diff Detail

Event Timeline

zero9178 created this revision.Jul 5 2023, 12:18 AM
Herald added a project: Restricted Project. · View Herald Transcript
zero9178 requested review of this revision.Jul 5 2023, 12:18 AM
gysit accepted this revision.Jul 5 2023, 12:53 AM

Thanks for the improvement. LGTM!

This revision is now accepted and ready to land.Jul 5 2023, 12:53 AM