[MemCpyOpt] Don't shorten memset if destination observable through unwinding
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 10 Oct 2020 15:47:20 +0000 (17:47 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 13 Oct 2020 19:12:19 +0000 (21:12 +0200)
commit39c39e8a7f09ff8f0385ef9962d1075d9559d139
treebf2f58baa1d679df0faa693f1c2da6f2e7c98d18
parent10f1ca99b498347186ec74b01046ad292bde9a4c
[MemCpyOpt] Don't shorten memset if destination observable through unwinding

MemCpyOpt can shorten a memset if it is later partially overwritten
by a memcpy. It checks that the destination is not read in between,
but we also need to make sure that the destination cannot be observed
via unwinding.

Differential Revision: https://reviews.llvm.org/D89190
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/test/Transforms/MemCpyOpt/memset-memcpy-redundant-memset.ll