[clang] Add spirv-val compilation step when targeting SPIR-V (PR #188150)

Finn Plummer via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 13:50:00 PDT 2026


================
@@ -574,18 +599,31 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch,
   return DAL;
 }
 
-bool HLSLToolChain::requiresValidation(DerivedArgList &Args) const {
-  if (!Args.hasArg(options::OPT_dxc_Fo))
+bool HLSLToolChain::requiresValidation(DerivedArgList &Args,
+                                       bool Diagnose) const {
+  bool HasFo = Args.hasArg(options::OPT_dxc_Fo);
+  bool DisableValidation =
+      Args.getLastArg(options::OPT_dxc_disable_validation) != nullptr;
+
+  if (DisableValidation || !HasFo)
     return false;
 
-  if (Args.getLastArg(options::OPT_dxc_disable_validation))
+  if (getArch() != llvm::Triple::spirv) {
----------------
inbelic wrote:

nit: This path only seems valid if it is dxil not just not spirv

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


More information about the cfe-commits mailing list