[llvm-branch-commits] [clang] [llvm] [clang][Driver][DirectX] Add /Zs flag support (PR #204459)

Vladislav Dzhidzhoev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jun 26 04:29:03 PDT 2026


https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/204459

>From 8179e4a95c0f14357e812369dcdf15b9e4a17186 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin <ikuklin at accesssoftek.com>
Date: Fri, 19 Jun 2026 15:42:05 +0500
Subject: [PATCH 1/5] Adjust Options.td

---
 clang/include/clang/Options/Options.td | 31 +++++++++++---------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/clang/include/clang/Options/Options.td b/clang/include/clang/Options/Options.td
index e2a14d364f457..ceb430029aba1 100644
--- a/clang/include/clang/Options/Options.td
+++ b/clang/include/clang/Options/Options.td
@@ -9319,9 +9319,10 @@ def _SLASH_ZH_SHA1 : CLFlag<"ZH:SHA1">,
   HelpText<"Use SHA1 for file checksums in debug info">,
   Alias<gsrc_hash_EQ>, AliasArgs<["sha1"]>;
 def _SLASH_ZH_SHA_256 : CLFlag<"ZH:SHA_256">,
-                        HelpText<"Use SHA256 for file checksums in debug info">,
-                        Alias<gsrc_hash_EQ>,
-                        AliasArgs<["sha256"]>;
+  HelpText<"Use SHA256 for file checksums in debug info">,
+  Alias<gsrc_hash_EQ>, AliasArgs<["sha256"]>;
+def _SLASH_Zi : CLFlag<"Zi", [CLOption, DXCOption]>, Alias<g_Flag>,
+  HelpText<"Enable debug information">;
 def _SLASH_Zp : CLJoined<"Zp">,
   HelpText<"Set default maximum struct packing alignment">,
   Alias<fpack_struct_EQ>;
@@ -9661,22 +9662,14 @@ def dxc_Fc : DXCJoinedOrSeparate<"Fc">,
   HelpText<"Output assembly listing file">;
 def dxc_Frs : DXCJoinedOrSeparate<"Frs">,
   HelpText<"Output additional root signature object file">;
-def dxc_Zss : DXCFlag<"Zss">,
-              HelpText<"Compute Shader Hash considering source information">;
-def dxc_Zsb : DXCFlag<"Zsb">,
-              HelpText<"Compute Shader Hash considering only output binary">;
 def dxc_Fd
     : DXCJoinedOrSeparate<"Fd">,
       HelpText<"Write debug information to the given file, or automatically "
                "named file in directory when ending in '/'">;
-def dxc_Qembed_debug
-    : DXCFlag<"Qembed_debug">,
-      HelpText<"Embed PDB in shader container (must be used with /Zi)">;
-def dxc_Zi : Option<["/", "-"], "Zi", KIND_FLAG>,
-             Group<dxc_Group>,
-             Alias<g_Flag>,
-             Visibility<[CLOption, DXCOption]>,
-             HelpText<"Enable debug information">;
+def dxc_Zss : DXCFlag<"Zss">,
+              HelpText<"Compute Shader Hash considering source information">;
+def dxc_Zsb : DXCFlag<"Zsb">,
+              HelpText<"Compute Shader Hash considering only output binary">;
 def dxil_validator_version : Option<["/", "-"], "validator-version", KIND_SEPARATE>,
   Group<dxc_Group>, Flags<[HelpHidden]>,
   Visibility<[DXCOption, ClangOption, CC1Option]>,
@@ -9771,9 +9764,11 @@ def spirv_validator_path_EQ : Joined<["--"], "spirv-val-path=">, Group<dxc_Group
   HelpText<"SPIRV validator installation path">;
 def dxc_disable_validation : DXCFlag<"Vd">,
   HelpText<"Disable validation">;
-def dxc_gis
-    : DXCFlag<"Gis">,
-      HelpText<"Enable IEEE strict mode (equivalent to -ffp-model=strict)">;
+def dxc_gis : DXCFlag<"Gis">,
+  HelpText<"Enable IEEE strict mode (equivalent to -ffp-model=strict)">;
+def dxc_Qembed_debug
+    : DXCFlag<"Qembed_debug">,
+      HelpText<"Embed PDB in shader container (must be used with /Zi)">;
 def spirv : DXCFlag<"spirv">,
   HelpText<"Generate SPIR-V code">;
 def metal : DXCFlag<"metal">, HelpText<"Generate Metal library">;

>From a5dc61c04e2661580a8cb9195ef394299b624ef7 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin <ikuklin at accesssoftek.com>
Date: Fri, 19 Jun 2026 16:08:21 +0500
Subject: [PATCH 2/5] Rename local Zi to HasDebug

---
 clang/lib/Driver/ToolChains/Clang.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index b3b8280de3006..1a4f4fcec2c9a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3854,16 +3854,16 @@ static void RenderHLSLOptions(const Driver &D, const ArgList &Args,
   }
   if (Arg *A = Args.getLastArg(options::OPT_dxc_Zsb))
     A->claim(); // /Zsb is the default behavior, no need to forward it to llc.
-  bool Zi = Args.hasArg(options::OPT_g_Flag);
+  bool HasDebug = Args.hasArg(options::OPT_g_Flag);
   bool Qembed_debug = Args.hasArg(options::OPT_dxc_Qembed_debug);
   Arg *Fd = Args.getLastArg(options::OPT_dxc_Fd);
-  if (Zi && !Fd && !Qembed_debug) {
+  if (HasDebug && !Fd && !Qembed_debug) {
     D.Diag(diag::warn_drv_dxc_no_output_for_debug);
     Qembed_debug = true;
   }
-  if (Qembed_debug && !Zi)
+  if (Qembed_debug && !HasDebug)
     D.Diag(diag::err_drv_no_debug_info_for_embed_debug);
-  if (Fd && !Zi)
+  if (Fd && !HasDebug)
     D.Diag(diag::err_drv_no_debug_info_for_Fd);
   if (Qembed_debug) {
     CmdArgs.push_back("-mllvm");

>From 804787cb6aaad188be040e317c99936db83cec03 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin <ikuklin at accesssoftek.com>
Date: Thu, 25 Jun 2026 23:57:46 +0500
Subject: [PATCH 3/5] Revert all changes in clang

---
 .../clang/Basic/DiagnosticDriverKinds.td      | 10 ----------
 clang/include/clang/Options/Options.td        | 12 ++++--------
 clang/lib/Driver/ToolChains/Clang.cpp         | 19 -------------------
 clang/test/Driver/dxc_debug.hlsl              | 14 ++------------
 4 files changed, 6 insertions(+), 49 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index a642797e518e4..8edac14f4972a 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -883,16 +883,6 @@ def err_drv_dxc_Fre_requires_Fo_metal
     : Error<"-Fre option requires -Fo option when targeting Metal">;
 def err_drv_dxc_invalid_shader_hash
     : Error<"cannot specify both /Zss and /Zsb">;
-def err_drv_no_debug_info_for_embed_debug
-    : Error<"must enable debug info with /Zi for /Qembed_debug">;
-def err_drv_no_debug_info_for_Fd
-    : Error<"/Fd specified, but no Debug Info was found in the shader; "
-            "please use the /Zi or /Zs switch to generate debug information "
-            "compiling this shader">;
-def warn_drv_dxc_no_output_for_debug
-    : Warning<"no output provided for debug - embedding PDB in shader "
-              "container; use /Qembed_debug to silence this warning">,
-      InGroup<DiagGroup<"default-embed-debug">>;
 def err_drv_hlsl_unsupported_target : Error<
   "HLSL code generation is unsupported for target '%0'">;
 def err_drv_hlsl_bad_shader_required_in_target : Error<
diff --git a/clang/include/clang/Options/Options.td b/clang/include/clang/Options/Options.td
index ceb430029aba1..919d46c449750 100644
--- a/clang/include/clang/Options/Options.td
+++ b/clang/include/clang/Options/Options.td
@@ -9322,7 +9322,7 @@ def _SLASH_ZH_SHA_256 : CLFlag<"ZH:SHA_256">,
   HelpText<"Use SHA256 for file checksums in debug info">,
   Alias<gsrc_hash_EQ>, AliasArgs<["sha256"]>;
 def _SLASH_Zi : CLFlag<"Zi", [CLOption, DXCOption]>, Alias<g_Flag>,
-  HelpText<"Enable debug information">;
+  HelpText<"Like /Z7">;
 def _SLASH_Zp : CLJoined<"Zp">,
   HelpText<"Set default maximum struct packing alignment">,
   Alias<fpack_struct_EQ>;
@@ -9662,10 +9662,6 @@ def dxc_Fc : DXCJoinedOrSeparate<"Fc">,
   HelpText<"Output assembly listing file">;
 def dxc_Frs : DXCJoinedOrSeparate<"Frs">,
   HelpText<"Output additional root signature object file">;
-def dxc_Fd
-    : DXCJoinedOrSeparate<"Fd">,
-      HelpText<"Write debug information to the given file, or automatically "
-               "named file in directory when ending in '/'">;
 def dxc_Zss : DXCFlag<"Zss">,
               HelpText<"Compute Shader Hash considering source information">;
 def dxc_Zsb : DXCFlag<"Zsb">,
@@ -9766,9 +9762,9 @@ def dxc_disable_validation : DXCFlag<"Vd">,
   HelpText<"Disable validation">;
 def dxc_gis : DXCFlag<"Gis">,
   HelpText<"Enable IEEE strict mode (equivalent to -ffp-model=strict)">;
-def dxc_Qembed_debug
-    : DXCFlag<"Qembed_debug">,
-      HelpText<"Embed PDB in shader container (must be used with /Zi)">;
+def : Option<["/", "-"], "Qembed_debug", KIND_FLAG>, Group<dxc_Group>,
+  Flags<[Ignored]>, Visibility<[DXCOption]>,
+  HelpText<"Embed PDB in shader container (ignored)">;
 def spirv : DXCFlag<"spirv">,
   HelpText<"Generate SPIR-V code">;
 def metal : DXCFlag<"metal">, HelpText<"Generate Metal library">;
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1a4f4fcec2c9a..323417e294d5a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3854,25 +3854,6 @@ static void RenderHLSLOptions(const Driver &D, const ArgList &Args,
   }
   if (Arg *A = Args.getLastArg(options::OPT_dxc_Zsb))
     A->claim(); // /Zsb is the default behavior, no need to forward it to llc.
-  bool HasDebug = Args.hasArg(options::OPT_g_Flag);
-  bool Qembed_debug = Args.hasArg(options::OPT_dxc_Qembed_debug);
-  Arg *Fd = Args.getLastArg(options::OPT_dxc_Fd);
-  if (HasDebug && !Fd && !Qembed_debug) {
-    D.Diag(diag::warn_drv_dxc_no_output_for_debug);
-    Qembed_debug = true;
-  }
-  if (Qembed_debug && !HasDebug)
-    D.Diag(diag::err_drv_no_debug_info_for_embed_debug);
-  if (Fd && !HasDebug)
-    D.Diag(diag::err_drv_no_debug_info_for_Fd);
-  if (Qembed_debug) {
-    CmdArgs.push_back("-mllvm");
-    CmdArgs.push_back("--dx-embed-debug");
-  }
-  if (Fd) {
-    CmdArgs.push_back("-mllvm");
-    CmdArgs.push_back(Args.MakeArgString("--dx-Fd=" + Twine(Fd->getValue())));
-  }
 }
 
 static void RenderOpenACCOptions(const Driver &D, const ArgList &Args,
diff --git a/clang/test/Driver/dxc_debug.hlsl b/clang/test/Driver/dxc_debug.hlsl
index d90be0bb5bad2..1a6c26c80750b 100644
--- a/clang/test/Driver/dxc_debug.hlsl
+++ b/clang/test/Driver/dxc_debug.hlsl
@@ -1,10 +1,8 @@
 // RUN: %clang_dxc -Tlib_6_7 -### -g %s 2>&1 | FileCheck %s --check-prefix=CHECK,CHECK-CMD
 // RUN: %clang_dxc -Tlib_6_7 -### /Zi %s 2>&1 | FileCheck %s
-// RUN: %clang_dxc -Tlib_6_7 -### /Zi /Qembed_debug %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-EMBED
+// RUN: %clang_dxc -Tlib_6_7 -### /Zi /Qembed_debug %s 2>&1 | FileCheck %s
 // RUN: %clang_dxc -Tlib_6_7 -### -Zi %s 2>&1 | FileCheck %s
-// RUN: %clang_dxc -Tlib_6_7 -### -Zi -Qembed_debug %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-EMBED
-// RUN: %clang_dxc -Tlib_6_7 -### -Zi /Fd %t.pdb %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-FD
-// RUN: %clang_dxc -Tlib_6_7 -### -Zi -Fd=%t.pdb %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-FD
+// RUN: %clang_dxc -Tlib_6_7 -### -Zi -Qembed_debug %s 2>&1 | FileCheck %s
 // RUN: %clang_dxc -Tlib_6_7 -### -Zi -Zss %s 2>&1 | FileCheck %s --check-prefix=CHECK,CHECK-ZSS
 // RUN: %clang_dxc -Tlib_6_7 -### -Zi -gcodeview %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-CV
 // RUN: %clang_dxc -Tlib_6_7 -### -Zi -gdwarf %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-DWARF
@@ -17,19 +15,11 @@
 // Make sure dwarf-version is 4.
 // CHECK-DWARF-SAME: -dwarf-version=4
 // Check that the flags are converted to their llc equivalents.
-// CHECK-EMBED-SAME: --dx-embed-debug
-// CHECK-FD-SAME: --dx-Fd=
 // CHECK-ZSS-SAME: -dx-Zss
 // Make sure dxc command line arguments are passed to clang invocation.
 // CHECK-SAME: -fdx-record-command-line
 // CHECK-CMD-SAME: --driver-mode=dxc -T lib_6_7 -### -g {{.*}}dxc_debug.hlsl
 
 // Check errors and warnings
-// RUN: %clang_dxc -Tlib_6_7 -### /Zi %s 2>&1 | FileCheck %s --check-prefix=WARN-EMBED
-// WARN-EMBED: warning: no output provided for debug - embedding PDB in shader container
-// RUN: not %clang_dxc -Tlib_6_7 -### /Qembed_debug %s 2>&1 | FileCheck %s --check-prefix=ERROR-NODBG0
-// ERROR-NODBG0: error: must enable debug info with /Zi for /Qembed_debug
-// RUN: not %clang_dxc -Tlib_6_7 -### /Fd %t.pdb %s 2>&1 | FileCheck %s --check-prefix=ERROR-NODBG1
-// ERROR-NODBG1: error: /Fd specified, but no Debug Info was found in the shader
 // RUN: not %clang_dxc -Tlib_6_7 -### -Zss -Zsb %s 2>&1 | FileCheck %s --check-prefix=CHECK-ZSS-ZSB
 // CHECK-ZSS-ZSB: cannot specify both /Zss and /Zsb

>From 215fc186a905c27accf5ef1d2421d20973eeeb25 Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Tue, 16 Jun 2026 05:43:51 +0200
Subject: [PATCH 4/5] [clang][Driver][DirectX] Add /Zs flag support

When DXC is called with `/Zs` flag, it emits "slim" debug info.
It means that ILDB section is omitted from the main DXContainer
output and from the output PDB file.

This patch reimplements similar behavior in llc and Clang.

`/Zs` flag has completely different meaning for clang-cl driver. It is an
alias for `-fsyntax-only` there.
`/Zs` flag description in TableGen was generalized, so as not to trigger
`-fsyntax-only` or `-g`. Thus, Driver checks for `-fsyntax-only` were
replaced with `isSyntaxOnly()` helper function calls.
---
 llvm/include/llvm/MC/MCDXContainerWriter.h    |  6 +-----
 llvm/lib/MC/MCDXContainerWriter.cpp           | 12 +++++++++++
 .../DirectX/DXILWriter/DXILWriterPass.cpp     |  7 +++++--
 .../DirectX/ContainerData/ContainerFlags.ll   | 20 +++++++++++++++++++
 4 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/llvm/include/llvm/MC/MCDXContainerWriter.h b/llvm/include/llvm/MC/MCDXContainerWriter.h
index 1df38b6ff906b..8461bb5f1e1b5 100644
--- a/llvm/include/llvm/MC/MCDXContainerWriter.h
+++ b/llvm/include/llvm/MC/MCDXContainerWriter.h
@@ -49,11 +49,7 @@ class LLVM_ABI MCDXContainerBaseWriter {
     llvm_unreachable("Unimplemented");
   }
 
-  virtual bool shouldSkipSection(StringRef SectionName, size_t SectionSize) {
-    // Skip empty and auxiliary sections.
-    return SectionSize == 0 || SectionName == PdbFileNameSectionName ||
-           SectionName == ModuleHashSectionName;
-  }
+  virtual bool shouldSkipSection(StringRef SectionName, size_t SectionSize);
 
 public:
   MCDXContainerBaseWriter() {}
diff --git a/llvm/lib/MC/MCDXContainerWriter.cpp b/llvm/lib/MC/MCDXContainerWriter.cpp
index 994b90fbcb66b..4f4ea5724cdb6 100644
--- a/llvm/lib/MC/MCDXContainerWriter.cpp
+++ b/llvm/lib/MC/MCDXContainerWriter.cpp
@@ -19,11 +19,23 @@ using namespace llvm;
 
 cl::opt<bool> EmbedDebug("dx-embed-debug",
                          cl::desc("Embed PDB in shader container"));
+cl::opt<bool> SlimDebug("dx-Zs",
+                        cl::desc("Generate slim PDB without ILDB part"));
 
 MCDXContainerTargetWriter::~MCDXContainerTargetWriter() = default;
 
 MCDXContainerBaseWriter::~MCDXContainerBaseWriter() = default;
 
+bool MCDXContainerBaseWriter::shouldSkipSection(StringRef SectionName,
+                                                size_t SectionSize) {
+  // Skip empty and auxiliary sections.
+  if (SectionSize == 0 || SectionName == PdbFileNameSectionName ||
+      SectionName == ModuleHashSectionName)
+    return true;
+  // Slim debug omits ILDB from all DXContainer outputs.
+  return SlimDebug && SectionName == "ILDB";
+}
+
 void MCDXContainerBaseWriter::write(raw_ostream &OS, const Triple &TT) {
   ArrayRef<MCDXContainerPart> Parts = collectParts();
 
diff --git a/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp b/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp
index 9bbb87327d749..f7869fb6b75cd 100644
--- a/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp
+++ b/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp
@@ -36,6 +36,7 @@ using namespace llvm;
 using namespace llvm::dxil;
 
 extern cl::opt<bool> EmbedDebug;
+extern cl::opt<bool> SlimDebug;
 extern cl::opt<std::string> PdbDebugPath;
 
 namespace {
@@ -231,14 +232,16 @@ class EmbedDXILPass : public llvm::ModulePass {
 
     bool HasDebugInfo = !M.debug_compile_units().empty();
 
+    if (SlimDebug && EmbedDebug)
+      reportFatalUsageError("/Qembed_debug is not compatible with /Zs");
+
     // Enable EmbedDebug if there is debug info, but it is not being written
     // to a PDB file.
-    if (HasDebugInfo && !EmbedDebug && PdbDebugPath.empty())
+    if (HasDebugInfo && !SlimDebug && PdbDebugPath.empty())
       EmbedDebug = true;
     if (!HasDebugInfo && EmbedDebug)
       reportFatalUsageError(
           "Missing debug info for embedding into the container");
-    // TODO: move this check to DXContainerPDB.cpp when /Zs is implemented.
     if (!HasDebugInfo && !PdbDebugPath.empty())
       reportFatalUsageError("Missing debug info for writing to the PDB file");
 
diff --git a/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll b/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll
index 36eb5b0b1b8e3..7a8cacc8af51d 100644
--- a/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll
+++ b/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll
@@ -31,6 +31,26 @@
 ; RUN: not llc %s --filetype=obj --dx-Fd=%t.pdb -o %t.cso 2>&1 | FileCheck %s --check-prefix=ERROR-NODBG-PDB
 ; ERROR-NODBG-PDB: Missing debug info for writing to the PDB file
 
+;; Check that slim debug (-dx-Zs) omits ILDB from container and companion PDB
+; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-Zs --dx-Fd=%t.pdb -o %t.cso
+; RUN: obj2yaml %t.cso | FileCheck %s --check-prefix=SLIM --implicit-check-not=ILDB
+; RUN: llvm-pdbutil pdb2yaml --dxcontainer %t.pdb | FileCheck %s --check-prefix=SLIM --implicit-check-not=ILDB
+
+; SLIM: Parts:
+; SLIM:   - Name:             HASH
+; SLIM:   - Name:             ILDN
+
+;; Check that /Zss can still hash from ILDB when /Zs omits it from output
+; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-Zs -dx-Zss -o %t.slim.cso
+; RUN: obj2yaml %t.slim.cso | FileCheck %s --check-prefix=SLIM-ZSS --implicit-check-not=ILDB
+; SLIM-ZSS:   - Name:            HASH
+; SLIM-ZSS:     Hash:
+; SLIM-ZSS:       IncludesSource:  true
+
+;; Check that slim debug and embed debug are mutually exclusive
+; RUN: not llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-Zs --dx-embed-debug -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERROR-ZS-EMBED
+; ERROR-ZS-EMBED: /Qembed_debug is not compatible with /Zs
+
 target triple = "dxil-unknown-shadermodel6.5-library"
 
 define i32 @foo(i32 %a) {

>From 62d34dbb56bc2dc4ca7969045f20eb2448bf41f7 Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Fri, 26 Jun 2026 13:27:36 +0200
Subject: [PATCH 5/5] Rename -dx-Zs to -dx-slim-debug for clarity

---
 llvm/lib/MC/MCDXContainerWriter.cpp                       | 2 +-
 llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/MC/MCDXContainerWriter.cpp b/llvm/lib/MC/MCDXContainerWriter.cpp
index 4f4ea5724cdb6..96df9103a1e26 100644
--- a/llvm/lib/MC/MCDXContainerWriter.cpp
+++ b/llvm/lib/MC/MCDXContainerWriter.cpp
@@ -19,7 +19,7 @@ using namespace llvm;
 
 cl::opt<bool> EmbedDebug("dx-embed-debug",
                          cl::desc("Embed PDB in shader container"));
-cl::opt<bool> SlimDebug("dx-Zs",
+cl::opt<bool> SlimDebug("dx-slim-debug",
                         cl::desc("Generate slim PDB without ILDB part"));
 
 MCDXContainerTargetWriter::~MCDXContainerTargetWriter() = default;
diff --git a/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll b/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll
index 7a8cacc8af51d..ae06092791228 100644
--- a/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll
+++ b/llvm/test/CodeGen/DirectX/ContainerData/ContainerFlags.ll
@@ -31,8 +31,8 @@
 ; RUN: not llc %s --filetype=obj --dx-Fd=%t.pdb -o %t.cso 2>&1 | FileCheck %s --check-prefix=ERROR-NODBG-PDB
 ; ERROR-NODBG-PDB: Missing debug info for writing to the PDB file
 
-;; Check that slim debug (-dx-Zs) omits ILDB from container and companion PDB
-; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-Zs --dx-Fd=%t.pdb -o %t.cso
+;; Check that slim debug (-dx-slim-debug) omits ILDB from container and companion PDB
+; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-slim-debug --dx-Fd=%t.pdb -o %t.cso
 ; RUN: obj2yaml %t.cso | FileCheck %s --check-prefix=SLIM --implicit-check-not=ILDB
 ; RUN: llvm-pdbutil pdb2yaml --dxcontainer %t.pdb | FileCheck %s --check-prefix=SLIM --implicit-check-not=ILDB
 
@@ -41,14 +41,14 @@
 ; SLIM:   - Name:             ILDN
 
 ;; Check that /Zss can still hash from ILDB when /Zs omits it from output
-; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-Zs -dx-Zss -o %t.slim.cso
+; RUN: llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-slim-debug -dx-Zss -o %t.slim.cso
 ; RUN: obj2yaml %t.slim.cso | FileCheck %s --check-prefix=SLIM-ZSS --implicit-check-not=ILDB
 ; SLIM-ZSS:   - Name:            HASH
 ; SLIM-ZSS:     Hash:
 ; SLIM-ZSS:       IncludesSource:  true
 
 ;; Check that slim debug and embed debug are mutually exclusive
-; RUN: not llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-Zs --dx-embed-debug -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERROR-ZS-EMBED
+; RUN: not llc %S/Inputs/SourceInfo.ll --filetype=obj -dx-slim-debug --dx-embed-debug -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERROR-ZS-EMBED
 ; ERROR-ZS-EMBED: /Qembed_debug is not compatible with /Zs
 
 target triple = "dxil-unknown-shadermodel6.5-library"



More information about the llvm-branch-commits mailing list