]> granicus.if.org Git - llvm/commit
Merging r245588:
authorTom Stellard <thomas.stellard@amd.com>
Thu, 19 Nov 2015 15:52:37 +0000 (15:52 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 19 Nov 2015 15:52:37 +0000 (15:52 +0000)
commit3f4c496a9449877189c27c537c0c7699610d6ddb
tree38b98df389a50c0fd07c892205612c09c4a7dbe4
parentdf2c69a0e69c251daa2dd021d700cd2358ddeb80
Merging r245588:

------------------------------------------------------------------------
r245588 | aprantl | 2015-08-20 14:23:56 -0400 (Thu, 20 Aug 2015) | 11 lines

Fix a debug location handling bug in GVN.
Caught by the famous "DebugLoc describes the currect SubProgram" assertion.

When GVN is removing a nonlocal load it updates the debug location of the
SSA value it replaced the load with with the one of the load. In the
testcase this actually overwrites a valid debug location with an empty one.

In reality GVN has to make an arbitrary choice between two equally valid
debug locations. This patch changes to behavior to only update the
location if the value doesn't already have a debug location.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@253571 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
test/DebugInfo/gvn.ll [new file with mode: 0644]