[InstCombine] Avoid deleting volatile memcpys.
authorPatrick Walton <pcwalton@fb.com>
Sun, 30 Oct 2022 00:34:57 +0000 (17:34 -0700)
committerPatrick Walton <pcwalton@fb.com>
Sun, 30 Oct 2022 09:40:16 +0000 (02:40 -0700)
commitcb2cb2d201811d95d4f35337817faea05654d8f0
tree499debe907f678e903363fc0f3ab721fbdb69ee7
parent8357ff6f3d6d0582279d7cc4ee3db04ce2b46318
[InstCombine] Avoid deleting volatile memcpys.

InstCombine can replace memcpy to an alloca with a pointer directly to the
source in certain cases. Unfortunately, it also did so for volatile memcpys.
This patch makes it stop doing that.

This was discovered in D136822.

Differential Revision: https://reviews.llvm.org/D137031
llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
llvm/test/Transforms/InstCombine/memcpy-from-global.ll