Page MenuHomePhabricator

[mir-strip-debug] Optionally preserve debug info that wasn't from debugify/mir-debugify
ClosedPublic

Authored by dsanders on Apr 10 2020, 10:11 AM.

Details

Summary

A few tests start out with debug info and expect it to reach
the output. For these tests we shouldn't strip the debug info

Diff Detail

Event Timeline

dsanders created this revision.Apr 10 2020, 10:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2020, 10:11 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
aprantl added inline comments.Apr 10 2020, 10:24 AM
llvm/lib/CodeGen/MachineStripDebug.cpp
36

Stripping only debug info added by the debugify pass.?

vsk added inline comments.Apr 10 2020, 11:06 AM
llvm/lib/CodeGen/MachineStripDebug.cpp
108

I think the default value for OnlyDebugified should come from a cl::opt (e.g. -mir-strip-debugify-only=0|1). Otherwise, changing the behavior of -mir-strip-debug would require further compiler changes.

dsanders marked 2 inline comments as done.Apr 10 2020, 11:10 AM
dsanders added inline comments.
llvm/lib/CodeGen/MachineStripDebug.cpp
36

That sounds like it's stripping debug info when it's not stripping it.
Not stripping debug info (debugify metadata not found)?

108

That makes sense to me

dsanders updated this revision to Diff 256668.Apr 10 2020, 2:25 PM

Option-controlled default
Improve message when declining to strip debug info

vsk accepted this revision.Apr 10 2020, 2:28 PM

Looks good! I'll send a follow up change so we can share some of the stripping logic with the IR-level debugify pass.

llvm/lib/CodeGen/MachineStripDebug.cpp
36

Sgtm.

This revision is now accepted and ready to land.Apr 10 2020, 2:28 PM
This revision was automatically updated to reflect the committed changes.