OSDN Git Service

Resubmit "[DebugInfo] Update loop metadata for inlined loops"
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>
Mon, 20 May 2019 13:02:30 +0000 (13:02 +0000)
committerOrlando Cazalet-Hyams <orlando.hyams@sony.com>
Mon, 20 May 2019 13:02:30 +0000 (13:02 +0000)
commit2d3f411b4ab8eb249d788622b521f1a4fc1aa76a
tree04f0a324783996162e6d49300aa0dbbda6c3155d
parent5eebfc3d0ee0d7f235cc04b6a283464808cadb5d
Resubmit "[DebugInfo] Update loop metadata for inlined loops"

This reverts commit 95805bc425b264805a472232a75ed2ffe58aceda.
I've squashed the test fix into this commit.

[DebugInfo] Update loop metadata for inlined loops

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 because that patch uses loop metadata to
determine the DILocation for the branches of new loop preheaders.

Reviewers: aprantl, dblaikie, anemet

Reviewed By: aprantl

Subscribers: eraman, hiraditya, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D61933

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361149 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/InlineFunction.cpp
test/Transforms/Inline/inlined-loop-metadata.ll [new file with mode: 0755]