[DSE] Use precise loc for memset_chk during overwrite checks
authorFlorian Hahn <flo@fhahn.com>
Fri, 2 Dec 2022 11:28:22 +0000 (11:28 +0000)
committerFlorian Hahn <flo@fhahn.com>
Fri, 2 Dec 2022 11:28:56 +0000 (11:28 +0000)
commitaf694c5e8d3dd3c6bf857a79b843006548c2901a
tree82f4eba497e2282710df21a02cfc8235b2506d2d
parent82a5f1c62b64830069139d5840675588577a8711
[DSE] Use precise loc for memset_chk during overwrite checks

memset_chk may not write the number of bytes specified by the third
argument, if it is larger than the destination size (specified as 4th
argument).

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D115167
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/Transforms/DeadStoreElimination/libcalls-chk.ll