This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix line number attribution in mldst-motion
ClosedPublic

Authored by Orlando on Aug 26 2022, 8:13 AM.

Details

Summary

Taking the example from the test included in this patch:

$ cat test.cpp -n

1	void fun(int *a, int cond) {
2	  if (cond)
3	    a[1] = 1;
4	  else
5	    a[1] = 2;
6	}

mldst-motion will merge and sink the stores in if.then and if.else into
if.end. The resultant PHI, gep and store should be attributed line zero
with the innermost common scope rather than picking a debug location from
one of the original stores.

Diff Detail

Event Timeline

Orlando created this revision.Aug 26 2022, 8:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2022, 8:13 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.Aug 26 2022, 8:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2022, 8:13 AM
djtodoro accepted this revision.Aug 28 2022, 1:54 AM

lgtm, thanks

llvm/test/DebugInfo/Generic/mldst-motion-dbg.ll
26

Nit: could drop dso_local and local_unnamed_addr #0

74–77

No need for tbaa.

This revision is now accepted and ready to land.Aug 28 2022, 1:54 AM
This revision was landed with ongoing or failed builds.Aug 30 2022, 2:08 AM
This revision was automatically updated to reflect the committed changes.
Orlando marked an inline comment as done.Aug 30 2022, 2:10 AM

Done, thanks!