There are cases when we have to merge TBAA access tags with the same base access type, but different final access types. For example, accesses to different members of the same structure may be vectorized into a single load or store instruction. Since we currently assume that the tags to merge always share the same final access type, we incorrectly return a tag that describes an access to one of the original final access types as the generic tag. This patch fixes that by producing generic tags for the common type and not the final access types of the original tags.
Resolves:
PR35225: Wrong tbaa metadata after load store vectorizer due to recent change
https://bugs.llvm.org/show_bug.cgi?id=35225
Can you please *explain* the problem in the patch description.
Also, we're now creating new metadata nodes speculatively (i.e., in cases where we we'll return false); can we avoid doing that? (maybe using a lambda function would help?)