This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking] Fix mem2reg misidentifying unlinked stores
ClosedPublic

Authored by Orlando on Mar 17 2023, 8:10 AM.

Details

Summary

updateForDeletedStore updates the assignment tracking debug info for a store that is about to be deleted by mem2reg. For each variable backed by the target alloca, if a dbg.assign exists it is kept (well - it's downgraded to a dbg.value). If there's not a linked dbg.assign for a variable which is backed by the target alloca a dbg.value is inserted now. This patch fixes a bug whereby a store with a linked dbg.assign that describes a fragment different to the one linked to the alloca was not counted for the variable, leading to both keeping the dbg.assign (downgrading it) and inserting a new one.

Diff Detail

Event Timeline

Orlando created this revision.Mar 17 2023, 8:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2023, 8:10 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.Mar 17 2023, 8:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2023, 8:10 AM

I've added D145511 as a dependency to reduce churn; the patches are independent, but they touch the same area so it's easier to arbitrarily pick an order for them to land

StephenTozer accepted this revision.Mar 21 2023, 11:47 AM

Simple enough, LGTM.

This revision is now accepted and ready to land.Mar 21 2023, 11:47 AM
This revision was landed with ongoing or failed builds.Mar 22 2023, 7:19 AM
This revision was automatically updated to reflect the committed changes.