[llvm] Add support for PSV EntryFunctionName (PR #84409)

Chris B via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 08:23:13 PDT 2024


================
@@ -347,6 +353,11 @@ void DXContainerYAML::PSVInfo::mapInfoForVersion(yaml::IO &IO) {
   IO.mapRequired("NumThreadsX", Info.NumThreadsX);
   IO.mapRequired("NumThreadsY", Info.NumThreadsY);
   IO.mapRequired("NumThreadsZ", Info.NumThreadsZ);
+
+  if (Version == 2)
+    return;
+
+  IO.mapRequired("EntryFunctionName", Info.EntryFunctionName);
----------------
llvm-beanz wrote:

In the YAML this should be a string not an integer. The Integer is the offset into the string table, for the textual dump we want to read this out into a string and be able to rebuild the string table.

The `DirectX::PSVRuntimeInfo` object has a method `getStringTable()`, which returns a StringRef that represents the full string table (just a bunch of packed null-terminated strings). The new field is an offset into that table for where the entry function name is stored.

In `dxcontainer2yaml.cpp` we'll want to translate that offset to a string that is stored in the `DXContainerYAML::PSVInfo` object, and we'll need to pass the string into the MC writer to add it into the string table builder.

https://github.com/llvm/llvm-project/pull/84409


More information about the llvm-commits mailing list