When we have patterns like
loop:
%la = load %ptr, !tbaa %lba = load %ptr, !tbaa !noalias
AliasSetTracker would previously think that the two types of annotation for
the pointer conflict, dropping both for the purpose of determining alias sets.
That is clearly way too conservative, as the tbaa is still valid whether or
not one of the memory accesses has additional AA metadata. We could go
one step further and attempt to properly merge the noalias metadata,
but it's not clear that that would be worth it since that may introduce
additional MD nodes, which may be undesirable since this is merely an
Analysis. For now, just take care of the simple case above, and keep
dropping conflicting noalias and alias.scope metadata, but keep tbaa
if it matches.
I'd prefer that we handle this in a way that the symmetric between the TBAA and NoAlias metadata. If TBAA conflict, set TBAA to nullptr. If NoAlias conflict, set NoAlias to nullptr, same with Scope. Please put this part of the logic into a member function on AAMDNodes (so that we can keep it in sync with anything else we add there). If there's nothing left (i.e. AAMDNodes's operator bool returns false), then set AAInfo to getTombstoneKey().