This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Nullify DBG_VALUE_LISTs in DebugValueManager
ClosedPublic

Authored by aheejin on May 16 2021, 6:42 PM.

Details

Summary

WebAssemblyDebugValueManager class currently does not handle
DBG_VALUE_LIST instructions correctly for two reasons, which are
explained in https://bugs.llvm.org/show_bug.cgi?id=50361.

This effectively nullifies DBG_VALUE_LISTs in
WebAssemblyDebugValueManager so that the info will appear as "optimized
out" in debuggers but still be at least correct in the meantime.

Diff Detail

Event Timeline

aheejin created this revision.May 16 2021, 6:42 PM
aheejin requested review of this revision.May 16 2021, 6:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2021, 6:42 PM
dschuff accepted this revision.May 17 2021, 9:24 AM

If I'm understanding this correctly, we only create a WebAssemblyDebugValueManager object when we actually stackify a reg and move the def, correct?
I guess that still ends up invalidating a lot of debug info, since we always run explicit locals.
In the code you've seen, does the debug info all or mostly consist of DBG_VALUE_LISTs now, or is it still mostly DBG_VALUE, or a mix?
I'm just trying to get a sense for how much of a degradation in debug info quality we have now.
(Not that we shouldn't do this; clearly this is better than the loop-explosion we have now. I'm just trying to get a sense for how urgent the "real" fix is).

This revision is now accepted and ready to land.May 17 2021, 9:24 AM

Hi,

In the code you've seen, does the debug info all or mostly consist of DBG_VALUE_LISTs now, or is it still mostly DBG_VALUE, or a mix?
I'm just trying to get a sense for how much of a degradation in debug info quality we have now.

Until recently, variable locations that could not be described became "DBG_VALUE $noreg" instructions. With some recent patches from @StephenTozer , some of those locations can now be described with DBG_VALUE_LIST instructions. If I understand this patch correctly, for WebAssembly those DBG_VALUE_LIST instructions transition back to being "DBG_VALUE $noreg". There should be no regression in variable location coverage: instead, WebAssembly does not yet benefit from the additional locations now being recovered.

aheejin retitled this revision from [WebAssembly] Nullify DBG_VALUE_LISTS in DebugValueManager to [WebAssembly] Nullify DBG_VALUE_LISTs in DebugValueManager.May 17 2021, 10:57 AM
aheejin updated this revision to Diff 345942.May 17 2021, 11:08 AM

Improve comments and CHECK line

Until recently, variable locations that could not be described became "DBG_VALUE $noreg" instructions. With some recent patches from @StephenTozer , some of those locations can now be described with DBG_VALUE_LIST instructions. If I understand this patch correctly, for WebAssembly those DBG_VALUE_LIST instructions transition back to being "DBG_VALUE $noreg". There should be no regression in variable location coverage: instead, WebAssembly does not yet benefit from the additional locations now being recovered.

Great, thanks for the clarification.

@jmorse Thanks for your help!