This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][InstrRef][NFC Update LDV to use generic DBG_VALUE* MI interface
ClosedPublic

Authored by StephenTozer on Jun 20 2022, 3:07 AM.

Details

Summary

Currently, InstrRefLDV only handles DBG_VALUE instructions, not DBG_VALUE_LIST, and as a result of this it handles these instructions using functions that only work for that type of debug value, i.e. using getOperand(0) to get the debug operand. This patch changes this to use the generic debug value functions, such as getDebugOperand and isDebugOffsetImm, as well as adding an IsVariadic field to the DbgValueProperties class and a few other minor changes to acknowledge DBG_VALUE_LISTs. Note that this patch does not add support for DBG_VALUE_LIST here, but is a precursor to other patches that do add that support.

Diff Detail

Event Timeline

StephenTozer created this revision.Jun 20 2022, 3:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 3:07 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
StephenTozer requested review of this revision.Jun 20 2022, 3:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 3:07 AM
StephenTozer edited the summary of this revision. (Show Details)Jun 20 2022, 3:11 AM
StephenTozer added reviewers: jmorse, Orlando.
StephenTozer added a project: debug-info.
StephenTozer added a subscriber: debug-info.
Orlando accepted this revision.Jun 20 2022, 3:54 AM

LGTM

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
20–1

I would consider adding assert(!Prop.IsVariadic) above this line (or changing the emitMOLoc call to emitMOLoc(MO, Var, {NewExpr, Prop.Indirect, Prop.IsVariadic}) (or both), so that this line doesn't get out of sync with the if statement added at the start of this function, but YMMV - feel free to ignore this.

This revision is now accepted and ready to land.Jun 20 2022, 3:54 AM

Use IsVariadic when emitting a location for an entry value.

Update unit tests to match the new interface.

This revision was landed with ongoing or failed builds.Aug 22 2022, 8:34 AM
This revision was automatically updated to reflect the committed changes.