[llvm] [DirectX] Use an allow-list of DXIL compatible module metadata (PR #165290)
Deric C. via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 29 11:17:57 PDT 2025
================
@@ -364,6 +364,16 @@ static void cleanModuleFlags(Module &M) {
M.addModuleFlag(Flag.Behavior, Flag.Key->getString(), Flag.Val);
}
+using GlobalMDList = std::array<StringLiteral, 7>;
+
+// The following are compatible with DXIL but not emit with clang, they can
+// be added when applicable:
+// dx.typeAnnotations, dx.viewIDState, dx.dxrPayloadAnnotations
+static GlobalMDList CompatibleNamedModuleMDs = {
+ "llvm.ident", "llvm.module.flags", "dx.resources", "dx.valver",
+ "dx.shaderModel", "dx.version", "dx.entryPoints",
+};
----------------
Icohedron wrote:
This is a very nit-picky thing but I would put each element of the list on its own line.
One of the benefits is if there is a new commit, the diff will show the line(s) added or removed as opposed to a reviewer needing to scan for a change in a single line.
```suggestion
static GlobalMDList CompatibleNamedModuleMDs = {
"llvm.ident",
"llvm.module.flags",
"dx.resources",
"dx.valver",
"dx.shaderModel",
"dx.version",
"dx.entryPoints",
};
```
https://github.com/llvm/llvm-project/pull/165290
More information about the llvm-commits
mailing list