[MemoryLocation] Move DSE's logic to new MemLoc::getForDest helper (NFC).
authorFlorian Hahn <flo@fhahn.com>
Fri, 3 Dec 2021 09:12:01 +0000 (09:12 +0000)
committerFlorian Hahn <flo@fhahn.com>
Fri, 3 Dec 2021 09:12:01 +0000 (09:12 +0000)
commitf078536f46598b1a1e363aad6893fe9c3f90f5e5
treef20d884259ff0c713d9e4bd29154c582a2a76725
parent49d040ac978c60d48710d327d5d8b1bd0c9ad1fb
[MemoryLocation] Move DSE's logic to new MemLoc::getForDest helper (NFC).

DSE has some extra logic to determine the write location of library
calls like str*cpy and str*cat. This patch moves the logic to a new
MemoryLocation:getForDest variant, which takes a call and TLI.

This patch should be NFC, because no other places take advantage of the
new helper yet.

Suggested by @reames post-commit 7eec832def571.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D114872
llvm/include/llvm/Analysis/MemoryLocation.h
llvm/lib/Analysis/MemoryLocation.cpp
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp