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 metadata 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.
There are likely other places where metadata is not preserved on masked intrinsics, those will be fixed separately. It seems like there hasn't been any expectation of having specifically TBAA metadata information on intrinsics, but having them there can definitely be helpful (we create them in a project that uses LLVM as backend, and they do help with alias analysis).
this copies any metadata, right?
I think it makes sense to keep any metadata in this case, but it would be good to update the title & description to make this clear. And also extend the tests with a few different metadata kinds.