[PATCH] D78147: [LICM] Try to merge debug locations when sinking

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 13:31:12 PDT 2020


davide created this revision.
davide added reviewers: vsk, aprantl, jmorse, dblaikie.
Herald added subscribers: asbirlea, hiraditya.

The current strategy LICM uses when sinking for debuginfo is that picking the debug location of one of the uses.
This causes stepping to be wrong sometimes, as in the example in https://bugs.llvm.org/show_bug.cgi?id=45523 / rdar://problem/61750950 where lldb steps on dead code.

This patch introduces a generalization of `getMergedLocation()`, `getMergedLocations()`, that operates on a vector of locations instead of two, and try to merge all them together.
The API is used in LICM to try making the locations more correct


https://reviews.llvm.org/D78147

Files:
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/test/Transforms/LICM/sink-debuginfo-preserve.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78147.257468.patch
Type: text/x-patch
Size: 9599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200414/55968ba6/attachment.bin>


More information about the llvm-commits mailing list