This is an archive of the discontinued LLVM Phabricator instance.

[IR] Add MDBuilder helpers for the new TBAA metadata format
ClosedPublic

Authored by kosarev on Nov 13 2017, 5:09 AM.

Details

Diff Detail

Event Timeline

kosarev created this revision.Nov 13 2017, 5:09 AM
kosarev updated this revision to Diff 123770.Nov 21 2017, 5:25 AM

Changed the order of metadata nodes describing structure fields so that the type node comes first. This agrees with the order of nodes in access tags and type nodes in the old format where offsets come after type nodes. Also simplifies adopting the existing code to the new format a bit.

kosarev added inline comments.Nov 30 2017, 1:57 AM
include/llvm/IR/MDBuilder.h
153–155

We refer to this field in clang's CodeGenTBAA::getBaseTypeInfoHelper(), so I should either fix that function just after committing this patch (and then the first commit won't be buildable) or commit a series of changes so that every revision is buildable. Say, I could temporarily add a getType() method, then switch getBaseTypeInfoHelper() to use it, then rename the field, then fix getBaseTypeInfoHelper() to refer to the new name and then remove getType(). Can you please advice on what way is preferred and whether it would be okay to do that without pre-review?

hfinkel accepted this revision.Dec 14 2017, 3:02 PM

LGTM

include/llvm/IR/MDBuilder.h
153–155

You can commit this patch immediately followed by an update to Clang. You'll still trip some of the buildbots, but in the present configuration, that's acceptable.

This revision is now accepted and ready to land.Dec 14 2017, 3:02 PM
This revision was automatically updated to reflect the committed changes.

Clang is updated in rL320994.