Merging r351475:
------------------------------------------------------------------------
r351475 | rnk | 2019-01-17 21:46:53 +0100 (Thu, 17 Jan 2019) | 16 lines

[InstCombine] Don't sink dynamic allocas

Summary:
InstCombine's sinking algorithm only thinks about memory. It doesn't
think about non-memory constraints like stack object lifetime. It can
sink dynamic allocas across a stacksave call, which may be used with
stackrestore, which can incorrectly reduce the lifetime of the dynamic
alloca.

Fixes PR40365

Reviewers: hfinkel, efriedma

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D56872
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_80@351530 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed