[PATCH] D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2]

Chris Jackson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 18 16:12:19 PST 2022


chrisjackson created this revision.
Herald added subscribers: javed.absar, hiraditya.
chrisjackson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Second of two patches to enable salvaging of dbg.value intrinsics that have
multiple location ops pre-LSR.

This adds the core implementation. Much is shared with the original, single-op
recovery. Each optimised away location op is assigned a SCEVDbgValuebuilder that
generates a DIExpression and location ops that enable recovery of the location
value.

Most of the complexity lies in creating the final location op DIArglist, because
both the number of locations that will be optimsed away and the number of new
locations that will be required to recover the location values is unknown.
The final DIArglist is organised as follows:

  DIArglist(Induction Variable, [non optimised-out locations], [locations required for recovery expressions])

The final DIExpression is initialised empty. Its contents are formed by parsing the
 original (pre-LSR) left-to-right, pushing each element onto the new expression. When
 a DW_OP_LLVM_arg reference to an optimised-out location is encountered, the
relevant SCEVDbgValueBuilder is used to append both its recovery expression and
values onto the final expression and DIArglist as shown above. Using this method
avoids any inserts and forms both the final location list and expression with appends.


https://reviews.llvm.org/D120169

Files:
  llvm/include/llvm/Analysis/ScalarEvolution.h
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/test/Transforms/LoopStrengthReduce/debuginfo-scev-salvage-5.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120169.410039.patch
Type: text/x-patch
Size: 22395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220219/1cbab11a/attachment.bin>


More information about the llvm-commits mailing list