[SROA] Use copyMetadataForLoad() helper
authorNikita Popov <npopov@redhat.com>
Thu, 19 Jan 2023 16:04:06 +0000 (17:04 +0100)
committerNikita Popov <npopov@redhat.com>
Fri, 20 Jan 2023 14:24:10 +0000 (15:24 +0100)
commitd49b842ea2b466ead10a140037c90901438ba9d3
tree16ad6dfe3e7d959c3dd2e6b542b70a8b0c7c3180
parentfcd505d040ccc4d5ce8a4e704f36f7e605142935
[SROA] Use copyMetadataForLoad() helper

Instead of copying just nonnull metadata, use the generic helper
to copy metadata to the new load. This helper is specifically
designed for the case where the load type may change, so it's
safe to use in this context.
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/preserve-metadata.ll