{"id":13731768,"url":"https://github.com/inequation/spirv-tools-custom-opt-passes","last_synced_at":"2026-01-18T11:38:15.715Z","repository":{"id":140637550,"uuid":"201778391","full_name":"inequation/spirv-tools-custom-opt-passes","owner":"inequation","description":"A few custom passes for the SPIRV-Tools optimizer.","archived":false,"fork":false,"pushed_at":"2019-08-11T20:31:39.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-14T22:35:46.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inequation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-11T14:55:23.000Z","updated_at":"2019-09-20T11:45:33.000Z","dependencies_parsed_at":"2024-04-13T15:04:43.682Z","dependency_job_id":null,"html_url":"https://github.com/inequation/spirv-tools-custom-opt-passes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inequation%2Fspirv-tools-custom-opt-passes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inequation%2Fspirv-tools-custom-opt-passes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inequation%2Fspirv-tools-custom-opt-passes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inequation%2Fspirv-tools-custom-opt-passes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inequation","download_url":"https://codeload.github.com/inequation/spirv-tools-custom-opt-passes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253008448,"owners_count":21839647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:38.052Z","updated_at":"2026-01-18T11:38:15.660Z","avatar_url":"https://github.com/inequation.png","language":"C++","funding_links":[],"categories":["Graphics"],"sub_categories":[],"readme":"# SPIRV-Tools custom optimization passes\r\n\r\nThis is a collection of custom optimization passes for use with [SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Tools). They may or may not be merged into that project someday.\r\n\r\n# Usage\r\n\r\nInclude the header file:\r\n\r\n```cpp\r\n#include \"FuseMultiplyAddPass.h\"\r\n```\r\n\r\nAnd then, in your optimizer invocation, add it to your pass registration chain:\r\n\r\n```cpp\r\nspvtools::Optimizer Opt(GTargetEnvironment);\r\nOpt.RegisterPerformancePasses()\r\n\t.RegisterPass(std::make_unique\u003cspvtools::Optimizer::PassToken::Impl\u003e(std::make_unique\u003cspvtools::opt::FuseMultiplyAddPass\u003e()))\r\n\t.Run(Words, Count, \u0026OptimizedSPIRV);\r\n```\r\n\r\nPlease note that the implementation `.cpp` files require access to private sources of SPIRV-Tools, just like the original, internal optimizer passes.\r\n\r\n# Passes\r\n\r\n## [FuseMultiplyAddPass](FuseMultiplyAddPass.h)\r\n\r\nSearches for `OpFMul`s depended on solely by `OpFAdd`s (or `OpFSub`s via `OpFNegate`, if this feature is enabled). If neither operand is decorated with `NoContraction`, it replaces the two with a single `GLSL.std.450` `Fma` extended instruction.\r\n\r\nDoes not support the OpenCL `fma` instruction, but can be trivially extended to do so.\r\n\r\n# License\r\n\r\n```\r\nMIT License\r\n\r\nCopyright (c) 2019 Leszek Godlewski\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finequation%2Fspirv-tools-custom-opt-passes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finequation%2Fspirv-tools-custom-opt-passes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finequation%2Fspirv-tools-custom-opt-passes/lists"}