This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking] Downgrade dbg.assigns to dbg.values in mem2reg
ClosedPublic

Authored by Orlando on Mar 7 2023, 8:28 AM.

Details

Summary

For fully promoted variables dbg.assigns and dbg.values convey the same information and can be used interchangeably. This patch converts dbg.assigns to dbg.values for variables promoted by mem2reg. This reduces resource usage by reducing the amount of unnecessary function local metadata. The compile time tracker reports that CTMark projects build with LTO-O3-g with 0.4% fewer instructions retired and peak memory usage is reduced by 2.2%.

I would like to explore making "value-only" dbg.assigns cheaper in the future but this is a worthwhile improvement for the time being IMO.

Diff Detail

Event Timeline

Orlando created this revision.Mar 7 2023, 8:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 8:28 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.Mar 7 2023, 8:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 8:28 AM
jryans accepted this revision.Mar 13 2023, 9:11 AM
jryans added a subscriber: jryans.

Approach looks good to me, seems fine to land once you've addressed the comments below. 😄

llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
337
384
This revision is now accepted and ready to land.Mar 13 2023, 9:11 AM
This revision was landed with ongoing or failed builds.Mar 21 2023, 2:51 AM
This revision was automatically updated to reflect the committed changes.
Orlando marked 2 inline comments as done.

Done - thanks.