[PATCH] D79602: [SimplifyCFG] Remap rewritten debug intrinsic operands.

Ricky Zhou via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 15:14:27 PDT 2020


rickyz created this revision.
rickyz added a reviewer: vsk.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
rickyz updated this revision to Diff 262774.
rickyz added a comment.
Herald added a subscriber: ormris.
rickyz edited the summary of this revision.
rickyz updated this revision to Diff 262775.
rickyz edited the summary of this revision.
rickyz updated this revision to Diff 262777.

Oops, forgot to write a commit message.


rickyz added a comment.

Typo fix.


rickyz added a comment.

One more commit message typo, sorry for the noise!


FoldBranchToCommonDest clones instructions to a different basic block,
but handles debug intrinsics in a separate path. Previously, when
cloning debug intrinsics, their operands were not updated to reference
the correct cloned values. As a result, we would emit debug.value
intrinsics with broken operand references which are discarded in later
passes. This leads to incorrect debuginfo that reports incorrect values
for variables.

Fix this by remapping debug intrinsic operands when cloning them.

Fixes https://bugs.llvm.org/show_bug.cgi?id=45667.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79602

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79602.262777.patch
Type: text/x-patch
Size: 11609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200507/5d981538/attachment.bin>


More information about the llvm-commits mailing list