This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Test that LiveDebugVariables un-coalesces ranges over block boundaries
ClosedPublic

Authored by jmorse on Aug 16 2019, 6:47 AM.

Details

Summary

LiveDebugVariables can coalesce ranges of variable locations across multiple basic blocks. However when it recreates DBG_VALUE instructions, it has to recreate one DBG_VALUE per block, otherwise it doesn't represent the pre-regalloc layout and variable assignments can go missing.

This feature works -- however while mucking around with LiveDebugVariables, I commented it out (the loop here [0]) and no tests failed. Thus, here's a test that checks LiveDebugVariables preserves DBG_VALUEs across block boundaries.

[0] https://github.com/llvm/llvm-project/blob/0c476111317cb7aaa9a3e9f75e1c35f83122ee26/llvm/lib/CodeGen/LiveDebugVariables.cpp#L1358

Diff Detail

Repository
rL LLVM

Event Timeline

jmorse created this revision.Aug 16 2019, 6:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2019, 6:47 AM
aprantl accepted this revision.Aug 16 2019, 9:12 AM
aprantl added inline comments.
test/DebugInfo/MIR/X86/livedebugvariables-crossbb-interval.mir
3 ↗(On Diff #215584)

Nitpick: this isn't consistent with either name :-)

#define DEBUG_TYPE "livedebugvars"

static cl::opt<bool>
EnableLDV("live-debug-variables", cl::init(true),

cl::desc("Enable the live debug variables pass"), cl::Hidden);

Also, we should probably unify those two...

This revision is now accepted and ready to land.Aug 16 2019, 9:12 AM
This revision was automatically updated to reflect the committed changes.