[Local] Preserve range metadata if the type did not change
authorNikita Popov <npopov@redhat.com>
Fri, 20 Jan 2023 14:27:19 +0000 (15:27 +0100)
committerNikita Popov <npopov@redhat.com>
Fri, 20 Jan 2023 14:28:32 +0000 (15:28 +0100)
commita4898b437dbd76bf62c6fc2c5f015c327aa19190
tree530959255c05ae56c8e560b7fed08676d43638dd
parent4ece50737d5385fb80cfa23f5297d1111f8eed39
[Local] Preserve range metadata if the type did not change

In copyRangeMetadata() and by extension copyLoadMetadata(),
handle the trivial case where the type did not change, in which
case we can simply preserve the range metadata as is.
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/SROA/preserve-metadata.ll