[PATCH] D61933: [DebugInfo] Update loop metadata for inlined loops

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 01:37:53 PDT 2019


Orlando created this revision.
Orlando added reviewers: aprantl, dblaikie.
Orlando added a project: debug-info.
Herald added subscribers: llvm-commits, hiraditya, eraman.
Herald added a project: LLVM.

Currently, when a loop is cloned while inlining function (A) into function (B) the loop metadata is copied and then not modified at all. The loop metadata can encode the loop's start and end DILocations. Therefore, the new inlined loop in function (B) may have loop metadata which shows start and end locations residing in function (A).

This patch ensures loop metadata is updated while inlining so that the start and end DILocations are given the "inlinedAt" operand. I've also added a regression test for this.

This fix is required for D60831 <https://reviews.llvm.org/D60831> because that patch uses loop metadata to determine the DILocation for the branches of new loop preheaders.


Repository:
  rL LLVM

https://reviews.llvm.org/D61933

Files:
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/test/Transforms/Inline/inlined-loop-metadata.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61933.199561.patch
Type: text/x-patch
Size: 8524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190515/e0624990/attachment.bin>


More information about the llvm-commits mailing list