[PATCH] D56788: [DebugInfo][InstCombine] Prefer salvaging dbg.values over sinking them

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 12 08:32:56 PST 2019


jmorse updated this revision to Diff 186479.
jmorse marked 2 inline comments as done.
jmorse added a comment.
Herald added a subscriber: jdoerfert.

The issue with generating new DW_OP_derefs has been resolved by r353824, as a result we no longer change existing tests with this patch.

I realised at the same time that we should be emitting undef dbg.values at this stage: if we sink a dbg.value and cannot salvage it, then we should terminate any earlier location range. Trying the clang-3.4 build statistics I get the following results based on r353832 (note that the llvm-dwarfdump --statistics formula changed recently). First column variables-with-location coverage, second scope-bytes-covered.

r353832: 76.9%, 44.8%
salvage, no undef: 77.2%, 44.9%
salvage and undef: 77.2%, 45.5%

Adding the undefs loses 300 variable locations (0.008%), and yields 0.6% more scope bytes covered. Exactly where the scope-bytes-covered improvement comes from is a bit of a mystery to me, but it's an improvement nonetheless.

Note that I've added a reverse() on the iteration over DbgUsers... without this, the order of some dbg.values in Transforms/InstCombine/debuginfo_add.ll swap (!25 and !26). I.. don't really have a good explanation as to why.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56788/new/

https://reviews.llvm.org/D56788

Files:
  lib/Transforms/InstCombine/InstructionCombining.cpp
  test/Transforms/InstCombine/debuginfo-sink.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56788.186479.patch
Type: text/x-patch
Size: 5567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190212/93be81c7/attachment.bin>


More information about the llvm-commits mailing list