[llvm] [SPIR-V] Add -spirv-nonsemantic-debug-info-version to select the NSDI set (PR #223428)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 05:05:57 PDT 2026


================
@@ -246,11 +249,25 @@ std::string getExtInstSetName(SPIRV::InstructionSet::InstructionSet Set) {
   return "UNKNOWN_EXT_INST_SET";
 }
 
+uint32_t
+getNonSemanticDebugInfoVersion(SPIRV::InstructionSet::InstructionSet Set) {
+  switch (Set) {
+  case SPIRV::InstructionSet::NonSemantic_Shader_DebugInfo_100:
+    return 100;
+  case SPIRV::InstructionSet::NonSemantic_Shader_DebugInfo_200:
+    return 200;
+  default:
+    report_fatal_error(
+        "unexpected NonSemantic.Shader.DebugInfo instruction set");
----------------
MrSidims wrote:

I don't understand, how could we end up in the default branch of this switch, is it even reachable? Could you please elaborate on this?

A bit of thinking out loud. Per my understanding, regardless of the answer on the previous question, such diagnostic is undesired as per specification any unknown NonSemantic instruction set should be ignored. To guard users from producing something, that we can't process such flag should have a counter part in clang driver with the appropriate error message when something unknown is passed.


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


More information about the llvm-commits mailing list