Skip to content

Commit c20e7b6

Browse files
authored
[HLSL] update default validator version to 1.8. (#104040)
Change default validator version to 1.8 in Options.td. Remove the default value set in HLSL.cpp. Fixes #102963 This also helps #99910.
1 parent 648f4d0 commit c20e7b6

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8840,7 +8840,7 @@ def dxil_validator_version : Option<["/", "-"], "validator-version", KIND_SEPARA
88408840
Visibility<[DXCOption, ClangOption, CC1Option]>,
88418841
HelpText<"Override validator version for module. Format: <major.minor>;"
88428842
"Default: DXIL.dll version or current internal version">,
8843-
MarshallingInfoString<TargetOpts<"DxilValidatorVersion">>;
8843+
MarshallingInfoString<TargetOpts<"DxilValidatorVersion">, "\"1.8\"">;
88448844
def target_profile : DXCJoinedOrSeparate<"T">, MetaVarName<"<profile>">,
88458845
HelpText<"Set target profile">,
88468846
Values<"ps_6_0, ps_6_1, ps_6_2, ps_6_3, ps_6_4, ps_6_5, ps_6_6, ps_6_7,"

clang/lib/Driver/ToolChains/HLSL.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,6 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch,
283283
DAL->append(A);
284284
}
285285

286-
// Add default validator version if not set.
287-
// TODO: remove this once read validator version from validator.
288-
if (!DAL->hasArg(options::OPT_dxil_validator_version)) {
289-
const StringRef DefaultValidatorVer = "1.7";
290-
DAL->AddSeparateArg(nullptr,
291-
Opts.getOption(options::OPT_dxil_validator_version),
292-
DefaultValidatorVer);
293-
}
294286
if (!DAL->hasArg(options::OPT_O_Group)) {
295287
DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_O), "3");
296288
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -xhlsl -o - %s | FileCheck %s
2+
3+
// CHECK:!dx.valver = !{![[valver:[0-9]+]]}
4+
// CHECK:![[valver]] = !{i32 1, i32 8}
5+
6+
float bar(float a, float b);
7+
8+
float foo(float a, float b) {
9+
return bar(a, b);
10+
}

0 commit comments

Comments
 (0)