]> granicus.if.org Git - llvm/commit
[DebugInfo] Fix pr41175 Dead Store Elimination missing debug loc
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Fri, 12 Apr 2019 09:47:35 +0000 (09:47 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Fri, 12 Apr 2019 09:47:35 +0000 (09:47 +0000)
commite049fdb84bd5b52945dd6bceef6dde8c128b9778
treef67dcf8586efe49a6be7936e705c28aaa00cd28d
parentbcae242878f2381f40b05144e72cc4ee8f817ff6
[DebugInfo] Fix pr41175 Dead Store Elimination missing debug loc

Bug: https://bugs.llvm.org/show_bug.cgi?id=41175

In the bug test case the DSE pass is shortening the range of memory that a
memset is working on. A getelementptr is generated so that the new
starting address can be passed to memset. This instruction was not given
a DebugLoc.

To fix the bug, copy the DebugLoc from the memset instruction.

Patch by Orlando Cazalet-Hyams!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358270 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/DeadStoreElimination.cpp
test/Transforms/DeadStoreElimination/memset-missing-debugloc.ll [new file with mode: 0644]