Preserve metadata on masked intrinsics in auto-upgrade
authorKrzysztof Parzyszek <kparzysz@quicinc.com>
Fri, 23 Apr 2021 20:07:00 +0000 (15:07 -0500)
committerKrzysztof Parzyszek <kparzysz@quicinc.com>
Wed, 5 May 2021 20:51:46 +0000 (15:51 -0500)
commit1817dae1924144c19b9caec196f574c51d6d9957
tree5ed7c2b2e1156110edfc555df858d5e9cedae8f4
parent40147c33d17eca98d186628272a076a1bb3e6868
Preserve metadata on masked intrinsics in auto-upgrade

When auto-upgrade was replacing a call to a masked intrinsic, it would
not copy the metadata from the original call.

If an intrinsic had metadata, but did not need any updates, the metadata
would stay, but if an update was needed, the would end up being removed.
A similar effect could be observed with masked_expandload and
masked_compressstore, which at the moment are not handled by auto-upgrade:
the metadata remained untouched.

Differential Revision: https://reviews.llvm.org/D101201
llvm/lib/IR/AutoUpgrade.cpp
llvm/test/Bitcode/upgrade-masked-keep-metadata.ll [new file with mode: 0644]