[llvm] [DXIL] Consume Metadata Analysis information in passes (PR #108034)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 15:51:37 PDT 2024


================
@@ -65,18 +69,269 @@ static void emitResourceMetadata(Module &M, const DXILResourceMap &DRM,
       MDNode::get(M.getContext(), {SRVMD, UAVMD, CBufMD, SmpMD}));
 }
 
+static StringRef getShortShaderStage(Triple::EnvironmentType Env) {
+  switch (Env) {
+  case Triple::Pixel:
+    return "ps";
+  case Triple::Vertex:
+    return "vs";
+  case Triple::Geometry:
+    return "gs";
+  case Triple::Hull:
+    return "hs";
+  case Triple::Domain:
+    return "ds";
+  case Triple::Compute:
+    return "cs";
+  case Triple::Library:
+    return "lib";
+  case Triple::Mesh:
+    return "ms";
+  case Triple::Amplification:
+    return "as";
+  default:
+    break;
+  }
+  llvm_unreachable("Unsupported environment for DXIL generation.");
+  return "";
----------------
bogner wrote:

No need for `return` after `llvm_unreachable`.

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


More information about the llvm-commits mailing list