[LoopRotate] Add test case to show dbg value problem
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Fri, 13 Dec 2019 14:44:29 +0000 (15:44 +0100)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 16 Dec 2019 10:41:21 +0000 (11:41 +0100)
commit632deb6bd04022945468faef2dcaa8c9fdf1b0fd
treedfa85a35c84057aa8624e2c38be1f4f6049078ed
parent1c49553c19a7044fbbf4528b732926f19f210e54
[LoopRotate] Add test case to show dbg value problem

Summary:
In commit d60f34c20a2f31335c8d5626e (llvm-svn 317128,
PR35113) MergeBlockIntoPredecessor was changed into
discarding some dbg.value intrinsics referring to
PHI values, post-splice due to loop rotation.

That elimination of dbg.value intrinsics does not
consider which dbg.value to keep based on the context.
Such as always keeping the one that comes first textually,
or the need to keep several of them in case the variable
is changing it's value several times inside the basic block.

In the past that hasn't been such a big problem since
CodeGenPrepare::placeDbgValues has moved the dbg.value
to be next to the PHI node anyway. But after commit
00e238896cd8ad3a7d7 CodeGenPrepare isn't doing that
any longer, so we need to be more careful when avoiding
duplicate dbg.value intrinsics in MergeBlockIntoPredecessor.

This patch is just a pre commit of the test case.

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71479
llvm/test/Transforms/LoopRotate/dbg-value-duplicates-2.ll [new file with mode: 0644]