Squashed 'third_party/SPIRV-Tools/' changes from c75a1a46f..d18d0d92e
d18d0d92e Optimize DefUseManager allocations (#4709)
a123632ed Optimize Type::HashValue (#4707)
471428a04 spirv-opt: Add OpExecutionModeId support (#4719)
72e4475b4 Handle propagation of arrays with decorations (#4717)
899e53a1d Bump pathval from 1.1.0 to 1.1.1 in /tools/sva (#4716)
53078eec1 Add OpModuleProcessed to debug opcode (#4694)
0ad83f913 spirv-diff: Match OpSpecConstantComposite correctly (#4704)
940127a77 avoid unnecessary reallocations in GetOperandConstants (#4708)
44923beb5 Optimize Instruction::Instruction (#4705)
a383c476e Remove reference to protobuf internals from fuzzers (#4701)
ff91f9449 [spirv-val] Allow 0 Component Count for DebugTypeArray for Shader (#4706)
f182d0205 Generalize the copyright check (#4702)
9fe41e60d Update test for parsing memory access masks (#4703)
332475dbc spirv-diff: Handle OpSpecConstant array sizes (#4700)
9beb54513 Stabilize the output of spirv-diff (#4698)
845f3efb8 Disable spirv-diff tests. (#4695)
5b371918b Have scalar replacement use undef instead of null (#4691)
7fa9e746e Introduce spirv-diff (#4611)
b846f8f1d Complete handling of RayQueryKHR type (#4690)
20b122b2e Fix handling of Nontemporal image operand (#4692)
a73e72435 Fix typo in comment: SPIR-V section for debug instructions (#4683)
65ecfd109 Fix various source comment (doxygen) typos (#4680)
ff91b1c27 Start SPIRV-Tools v2022.2
b1877de5c Finalize SPIRV-Tools v2022.1
73735db94 Update CHANGES
d492ebded Update DEPS file (#4688)
5003644f5 Fix roll_deps.sh (#4687)
fb9a10cd4 spirv-opt: add pass to Spread Volatile semantics (#4667)
6938af7f8 Vulkan 1.3 (#4686)
e8439c1c9 Avoid infinite recursion in comparison operators on SmallVector (#4681)
58d8b4e29 linker: Address conversion error introduced in earlier rework (#4685)
c38495656 Linker improvements (#4679)
8a40f6de5 Add SPIR-V 1.6 support to wasm build (#4674)
42dc67891 Remove duplicated "the" from comments (#4666)
8fda47ca0 Disable a codepage warning on non-English OS (#4668)
05c839ca0 Improvements to disassembly within PassManager (#4677)
b9e0e13d1 Remove misleading comment. (#4676)
c5ee1bc7b Fix opt fuzzer test harness (#4670)
75e53b9f6 Avoid uninitialized access to instruction opcode (#4673)
df2aad68b val: interface struct with builtins must be Block (#4665)
5d0e3240f Patch location validation VUIDs (#4664)
7d768812e Basic support for SPIR-V 1.6 (#4663)
b7251d4fb reflect debug (#4662)
354a46a2a Rename strip reflect to strip nonsemantic (#4661)
4322c4b5a Refactor the disassembler code for reuse (#4616)
f0351b7bc Avoid id bound errors during opt fuzzing (#4658)
ff07cfd86 CMake iOS fixes: rely on CMAKE_SYSTEM_NAME and handle bundle installation (#4619)
e45279259 Simplify the as fuzzer target (#4647)
315615887 optimizer: restore previous ABI. (#4653)
a2260d3b1 Fix compilation (#4656)
d240d0db9 fix file encoding (#4654)
6926c3d9a treat google user type as normal semantic google. It's a backport from diligent fork (#4632)
b9e255b36 DefUseManager: rename comparison operators to 'CompareAndPrintDifferences' (#4624)
f37551d2b Use a struct (instead of tuple), with explicit member names. (#4621)
438096e0c Fix kokoro asan run (#4655)
64328e94d Avoid an extra map lookup (#4623)
1ed847f43 Fix endianness of string literals (#4622)
b162ede0d Use schema instead of reserved in header description (#4615)
1f3f0f185 Avoid uninitialised read when parsing hex float (#4646)
f9bcc82ec Exit when ID overflow occurs in a fuzzing build (#4652)
git-subtree-dir: third_party/SPIRV-Tools
git-subtree-split: d18d0d92e55f44da6af0dc87fb0e3c8034e9a3ac
diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp
index e74db26..330093e 100644
--- a/source/opt/optimizer.cpp
+++ b/source/opt/optimizer.cpp
@@ -288,6 +288,8 @@
RegisterPass(CreateStripDebugInfoPass());
} else if (pass_name == "strip-reflect") {
RegisterPass(CreateStripReflectInfoPass());
+ } else if (pass_name == "strip-nonsemantic") {
+ RegisterPass(CreateStripNonSemanticInfoPass());
} else if (pass_name == "set-spec-const-default-value") {
if (pass_args.size() > 0) {
auto spec_ids_vals =
@@ -322,6 +324,8 @@
RegisterPass(CreateLocalAccessChainConvertPass());
} else if (pass_name == "replace-desc-array-access-using-var-index") {
RegisterPass(CreateReplaceDescArrayAccessUsingVarIndexPass());
+ } else if (pass_name == "spread-volatile-semantics") {
+ RegisterPass(CreateSpreadVolatileSemanticsPass());
} else if (pass_name == "descriptor-scalar-replacement") {
RegisterPass(CreateDescriptorScalarReplacementPass());
} else if (pass_name == "eliminate-dead-code-aggressive") {
@@ -653,8 +657,12 @@
}
Optimizer::PassToken CreateStripReflectInfoPass() {
+ return CreateStripNonSemanticInfoPass();
+}
+
+Optimizer::PassToken CreateStripNonSemanticInfoPass() {
return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::StripReflectInfoPass>());
+ MakeUnique<opt::StripNonSemanticInfoPass>());
}
Optimizer::PassToken CreateEliminateDeadFunctionsPass() {
@@ -764,6 +772,11 @@
MakeUnique<opt::SSARewritePass>());
}
+Optimizer::PassToken CreateAggressiveDCEPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::AggressiveDCEPass>(false));
+}
+
Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface) {
return MakeUnique<Optimizer::PassToken::Impl>(
MakeUnique<opt::AggressiveDCEPass>(preserve_interface));
@@ -965,6 +978,11 @@
MakeUnique<opt::ReplaceDescArrayAccessUsingVarIndex>());
}
+Optimizer::PassToken CreateSpreadVolatileSemanticsPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::SpreadVolatileSemantics>());
+}
+
Optimizer::PassToken CreateDescriptorScalarReplacementPass() {
return MakeUnique<Optimizer::PassToken::Impl>(
MakeUnique<opt::DescriptorScalarReplacement>());