This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking][16/*] Account for assignment tracking in mldst-motion
ClosedPublic

Authored by Orlando on Sep 5 2022, 8:21 AM.

Details

Summary

mldst-motion will merge and sink the stores in if-diamond branches into the common successor. Attach a merged DIAssignID to the merged store.

Diff Detail

Event Timeline

Orlando created this revision.Sep 5 2022, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 8:21 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.Sep 5 2022, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 8:21 AM
jmorse accepted this revision.Sep 9 2022, 6:39 AM
jmorse added a subscriber: jmorse.

LGTM

This revision is now accepted and ready to land.Sep 9 2022, 6:39 AM
This revision was landed with ongoing or failed builds.Nov 15 2022, 3:30 AM
This revision was automatically updated to reflect the committed changes.
nikic added a subscriber: nikic.Dec 27 2022, 3:50 AM
nikic added inline comments.
llvm/test/DebugInfo/Generic/assignment-tracking/mldst-motion/diamond.ll
22

This looked a bit weird to me, so I want to double check that it is correct: %1 here is the new merged GEP inserted in the if.end block, while these dbg.assigns are in the if.then and if.else blocks. In other words, %1 does not dominate these dbg.assigns. Is that normal for debug intrinsics?

jmorse added inline comments.Dec 27 2022, 6:20 AM
llvm/test/DebugInfo/Generic/assignment-tracking/mldst-motion/diamond.ll
22

Thanks for checking in about this test!,

That's correct, this is checking for a use-before-def. The IR verifier permits debug intrinsics to do that without error -- it can happen whenever an instruction sinks, which occurs in numerous places, and we just tolerate that for debug intrinsics. That kind of transform is explicitly what this test is checking for.

nikic added inline comments.Dec 27 2022, 6:39 AM
llvm/test/DebugInfo/Generic/assignment-tracking/mldst-motion/diamond.ll
22

Makes sense, thanks for the explanation!