[MergeFuncs] Compare load instruction metadata
authorDing Xiang Fei <dingxiangfei2009@protonmail.ch>
Tue, 21 Mar 2023 08:45:51 +0000 (09:45 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 21 Mar 2023 08:45:51 +0000 (09:45 +0100)
commit8325d46a4ab803c6eeff28bf1bdafb43287ce557
tree900fb995b0d192a192a7b93a825170c4e7653fd9
parentd9b3a9442530c5db302c0af62196e6d907453a23
[MergeFuncs] Compare load instruction metadata

MergeFuncs currently merges load instructions with differing
semantically-relevant metadata, e.g. a load that has !nonnull
with one that does not.

Update FunctionComparator to make sure that metadata of both
loads is the same. Alternatively, it would be possilbe to ignore
the metadata during comparison, and then drop it during merging.

Differential Revision: https://reviews.llvm.org/D144682
llvm/include/llvm/Transforms/Utils/FunctionComparator.h
llvm/lib/Transforms/Utils/FunctionComparator.cpp