This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][7/N][InstrRef] Preserve indirectness when restoring variable locations
ClosedPublic

Authored by jmorse on Nov 22 2021, 9:37 AM.

Details

Summary

InstrRefBasedLDV observes when variable locations are clobbered, scans what values are available in the machine, and re-issues a DBG_VALUE for the variable if it can find another location. Unfortunately, I hadn't joined up the Indirectness flag, so if it did this to an Indirect Value, the indirectness would be dropped.

Fix this, and add a test that if we clobber a variable value (on the stack in this case), then the recovered variable location keeps the Indirect flag.

Diff Detail

Event Timeline

jmorse created this revision.Nov 22 2021, 9:37 AM
jmorse requested review of this revision.Nov 22 2021, 9:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 22 2021, 9:37 AM
Orlando accepted this revision.Nov 29 2021, 3:11 AM

LGTM

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
546–548

Maybe nit: Could you just copy ActiveVLocIt->second.Properties instead? Not a strong opinion.

This revision is now accepted and ready to land.Nov 29 2021, 3:11 AM
jmorse added inline comments.Nov 29 2021, 1:39 PM
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
546–548

Ah yeah, that'd work, I'll do that.

This revision was landed with ongoing or failed builds.Nov 29 2021, 1:57 PM
This revision was automatically updated to reflect the committed changes.