This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking][8/*] Add DIAssignID merging utilities
ClosedPublic

Authored by Orlando on Sep 5 2022, 5:14 AM.

Details

Summary

Add Instruction::mergeDIAssignID(ArrayRef<const Instruction* > SourceInstructions) which merges the DIAssignID metadata attachments on the SourceInstructions and this and replaces uses of the original IDs with the new shared one.

This is used when stores are merged, for example sinking stores out of a if-diamond CFG or vectorizing contiguous stores.

Diff Detail

Event Timeline

Orlando created this revision.Sep 5 2022, 5:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 5:14 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.Sep 5 2022, 5:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 5:14 AM
jmorse added a subscriber: jmorse.Sep 7 2022, 3:54 AM

LGTM

llvm/include/llvm/IR/Instruction.h
515

Worth adding the rider that if this instruction has no DIAssignID, then it is given one, no? (I think that's what the 3rd unit test is doing?)

llvm/lib/IR/DebugInfo.cpp
848

"Uninserted instruction merged"?

866

(Style guide says ++It)

Orlando updated this revision to Diff 458707.Sep 8 2022, 5:49 AM
Orlando marked 3 inline comments as done.

+ Address review comments

jmorse accepted this revision.Sep 13 2022, 9:45 AM

LGTM

This revision is now accepted and ready to land.Sep 13 2022, 9:45 AM
This revision was landed with ongoing or failed builds.Nov 9 2022, 2:47 AM
This revision was automatically updated to reflect the committed changes.