opt: Add TrimCapabilities pass to spirv-opt tool (#5545)

Add an option to the spirv-opt tool to run the TrimCapabilitiesPass.
This commit is contained in:
Natalie Chouinard 2024-01-26 16:15:29 -05:00 committed by GitHub
parent b951948eaa
commit 0a6f0d1893
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -623,6 +623,8 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag,
pass_args.c_str());
return false;
}
} else if (pass_name == "trim-capabilities") {
RegisterPass(CreateTrimCapabilitiesPass());
} else {
Errorf(consumer(), nullptr, {},
"Unknown flag '--%s'. Use --help for a list of valid flags",

View File

@ -525,6 +525,10 @@ Options (in lexicographical order):)",
USR/SYS time are returned by getrusage() and can have a small
error.)");
printf(R"(
--trim-capabilities
Remove unnecessary capabilities and extensions declared within the
module.)");
printf(R"(
--upgrade-memory-model
Upgrades the Logical GLSL450 memory model to Logical VulkanKHR.
Transforms memory, image, atomic and barrier operations to conform