This is an archive of the discontinued LLVM Phabricator instance.

[Debugify] Use DebugifyLevel in Debugify original mode
ClosedPublic

Authored by djtodoro on Dec 13 2021, 3:42 AM.

Details

Summary

Before this patch the DebugifyLevel option was used for the synthetic mode, so after this, it will be used in the original mode as well.

Diff Detail

Event Timeline

djtodoro created this revision.Dec 13 2021, 3:42 AM
djtodoro requested review of this revision.Dec 13 2021, 3:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2021, 3:42 AM

Hi @djtodoro. The patch SGTM but I do have one concern/question regarding the test (inline comment).

llvm/lib/Transforms/Utils/Debugify.cpp
323–336

nit: missing o in Collect and s in dbg.declares.

llvm/test/Transforms/Util/Debugify/loc-only-original-mode.ll
7

This test feels prone to rot because it will pass even if the feature is not working as intended if A) the pass stops dropping intrinsics or B) the warning message is changed. I'm not sure what we could do instead though - do you have any ideas?

StephenTozer accepted this revision.Dec 15 2021, 4:49 AM

Aside from the mentioned nit, LGTM.

Normally I'd say that the test should also check that the debug values are actually being dropped, to ensure that the test doesn't silently become invalid if some future change causes the debug values to not be dropped. However, I don't think any future change would prevent the debug values from being dropped by deadargelim, so it should be safe I think.

llvm/lib/Transforms/Utils/Debugify.cpp
323–336

Accidentally removed the 'o' and 's'?

This revision is now accepted and ready to land.Dec 15 2021, 4:49 AM
StephenTozer requested changes to this revision.Dec 15 2021, 5:03 AM

Apologies, didn't see the existing comments on this review before submitting - given that the concern has been raised by another, it may be worth making a change to confirm that debug values have been dropped, and also check the error message. A simple way to do this might be to run the test twice, using -debugify-level=locations-and-variables for the second run, with a directive CHECK: drops dbg.value()/dbg.declare() - this should solve both issues by ensuring the test only passes if we are actually dropping debug info, and we are checking for the correct error message.

This revision now requires changes to proceed.Dec 15 2021, 5:03 AM

Apologies, didn't see the existing comments on this review before submitting - given that the concern has been raised by another, it may be worth making a change to confirm that debug values have been dropped, and also check the error message. A simple way to do this might be to run the test twice, using -debugify-level=locations-and-variables for the second run, with a directive CHECK: drops dbg.value()/dbg.declare() - this should solve both issues by ensuring the test only passes if we are actually dropping debug info, and we are checking for the correct error message.

FWIW this suggestion sounds like a good solution to me.

ormris removed a subscriber: ormris.Jan 18 2022, 4:31 PM
djtodoro updated this revision to Diff 416434.Mar 18 2022, 3:08 AM

Sorry for delay here...

@Orlando @StephenTozer Thanks a lot for your comments!

Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2022, 3:08 AM
StephenTozer accepted this revision.Mar 21 2022, 8:21 AM

Thanks for the change, LGTM

This revision is now accepted and ready to land.Mar 21 2022, 8:21 AM
This revision was automatically updated to reflect the committed changes.