[PATCH] D140900: [DebugInfo] Print empty MDTuples wrapped in MetadataAsValue inline

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 07:18:23 PDT 2023


Orlando added a comment.

This patch prints the tuple as `!{}` even if it's `distinct`, which I thought was reasonable when writing the patch. If a distinct empty tuple is used multiple times or is attached to multiple instructions however, the ID seems useful.

(example bot failure with distinct empty metadata: In https://lab.llvm.org/buildbot/#/builders/245/builds/7602/steps/5/logs/FAIL__Clang__type-metadata_cpp - the distinct MD is not used in multiple places in this case but it seems like a possibility)

With that in mind I think we should either further restrict this to non-distinct empty MD tuples (IMO still useful) or drop this patch (just continue to use metadata references, so `!2` inline and `!2 = !{}` (+-distinct) in the metadata list).

Does anyone have any strong feelings? @jmorse, @StephenTozer ?

If not, then, although I do prefer the inline printing aesthetically, I think that the extra code isn't worth it for the slight readability improvement (and test-writing convenience of not needing to check the metadata reference), and vote that we drop this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140900



More information about the llvm-commits mailing list