[PATCH] D132741: [DebugInfo] Fix line number attribution in mldst-motion

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 08:13:19 PDT 2022


Orlando created this revision.
Orlando added reviewers: jmorse, jryans, djtodoro.
Orlando added a project: debug-info.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Orlando requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


https://reviews.llvm.org/D132741

Files:
  llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
  llvm/test/DebugInfo/Generic/mldst-motion-dbg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132741.455912.patch
Type: text/x-patch
Size: 4813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220826/b1ee78b4/attachment.bin>


More information about the llvm-commits mailing list