[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/trunk@351475 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed