[PATCH] D131807: [DIrectX backend] emit metadata for entry.

Xiang Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 17:27:11 PDT 2022


python3kgae added a comment.

In D131807#3816334 <https://reviews.llvm.org/D131807#3816334>, @beanz wrote:

> Please break the testcase updates where you are just changing the triple out into a separate change, and feel free to land it without review.
>
> I have a lot of little bits of feedback, but I'm about to post my change for `dx.resources`, so we can look at how these two will come together.
>
> Not as part of this change, but at some point soon I want to refactor some of this code into a new library under llvm/lib/Frontend, so that we can share some of this code between the backend and Clang to reduce duplication.

Will create separate change for the triple only test update.
For 'dx.resource', the plan is to add entry md after 'dx.resources' is added. Then M.getNamedMetadata('dx.resources') to find the named MD created when create 'dx.resources'.



================
Comment at: llvm/lib/Target/DirectX/DXILMetadata.cpp:148
+    Metadata *MDVals[EntryMDSize];
+    MDVals[EntryMDFn] = Fn ? ValueAsMetadata::get(Fn) : nullptr;
+    MDVals[EntryMDName] = MDString::get(Ctx, Name.c_str());
----------------
beanz wrote:
> Can this be called if `Fn` is null? That seems like a bad state to be in.
That happens on the library profile when accessing the resource table from the entry metadata.

We should remove it for future shader model.
For older shader models, if driver only read resource table from the "dx.resources" metadata, we could remove it too. Not sure if anyone depends on the current format.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131807



More information about the llvm-commits mailing list