[RS4GC] Handle special cases in unreachable code for memcpy/memmov
authorMax Kazantsev <mkazantsev@azul.com>
Fri, 22 Jul 2022 04:29:29 +0000 (11:29 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Fri, 22 Jul 2022 04:30:43 +0000 (11:30 +0700)
commita40af8589e88f7ebaf81d11a9aa5a4eaf1735eff
tree0a254a6f552f2db60e651284784edac3aa6165c2
parentfd156f5d4ab3fcf813dbd76273bcbffdd4d22b87
[RS4GC] Handle special cases in unreachable code for memcpy/memmov

The existing code doesn't expect dummy values (undef, poison, null-derived
constants etc) as arguments of these intrinsics. However, they can be there
in unreached code. Currently we fail trying to find base for them.

Handle these cases separately. Return null as base for them to be consistent
with the handling in the main algorithm in findBaseDefiningValue.

Differential Revision: https://reviews.llvm.org/D129561
Reviewed By: apilipenko
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/test/Transforms/RewriteStatepointsForGC/pr56493.ll [new file with mode: 0644]