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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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? |
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'? |
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.
nit: missing o in Collect and s in dbg.declares.