[PATCH] D118416: [Metadata] Use temporary MD nodes when appending module flags during module linking

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 17:27:08 PST 2022


dblaikie added a comment.

> IMO, the first approach I mention above would be best (possibly with the second approach as a follow up!) since the resize() operation would be generally useful; there are lots of metadata nodes that are really just lists of arbitrary size, and that get extended later on (e.g., @dblaikie @aprantl, I think there are places in debug info IR where new nodes are allocated for this sort of thing, is that right?).

I'm actually not sure how many debug info nodes there are that get incrementally appended to... - the CU list itself, yes, but otherwise mostly the lists are made by frontends and made the right size the first time, I think? yeah, DIBuilder keeping a SmallVector of retained type nodes, then creating the necessary vector to create an MDNode from that in one shot, without incrementally appending.

But I could be wrong - just my rough estimate/recollection.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118416/new/

https://reviews.llvm.org/D118416



More information about the llvm-commits mailing list