[PATCH] D58403: [DebugInfo][CGP] Update dbg.values when updating memory address computations

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 07:10:47 PST 2019


jmorse updated this revision to Diff 188909.
jmorse added a comment.
This revision is now accepted and ready to land.

Avoid relying on placeDbgValues for this change. We already walk (forwards) through all instructions in a block looking to optimise them, add a dbg.value visitor that rewrites the dbg.value operand if it refers to a sunk address computation.

This works because CGP already keeps a cache of sunk addresses for each block, and we walk forwards through the block (which optimizeMemoryInst relies on anyway). Thus, we will only rewrite dbg.value operands for instructions after the sunk memory computation has been produced.

The test case will need to be updated when placeDbgValues gets limited: the first dbg.value will no longer be hoisted up a block, and the second will no longer go up one inst.


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

https://reviews.llvm.org/D58403

Files:
  lib/CodeGen/CodeGenPrepare.cpp
  test/DebugInfo/Generic/codegenprep-addrsink.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58403.188909.patch
Type: text/x-patch
Size: 5637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190301/54a6000e/attachment.bin>


More information about the llvm-commits mailing list