From 5370baeb7dfa540499680ab4ad4a268e5d4d17c7 Mon Sep 17 00:00:00 2001 From: Gergely Meszaros Date: Thu, 24 Jul 2025 06:55:17 -0700 Subject: [PATCH 1/3] [LLVM][Docs][SPIRV] Correct `-spirv-ext` option name, reorder The option is `-spirv-ext` not `-spirv-extensions`. Also move the examples after the description of the option, instead of after the list of extensions, where its easy to miss when skimming. --- llvm/docs/SPIRVUsage.rst | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/llvm/docs/SPIRVUsage.rst b/llvm/docs/SPIRVUsage.rst index 1f563fbfb725a..1e7ff420c60a2 100644 --- a/llvm/docs/SPIRVUsage.rst +++ b/llvm/docs/SPIRVUsage.rst @@ -131,9 +131,20 @@ Extensions The SPIR-V backend supports a variety of `extensions `_ that enable or enhance features beyond the core SPIR-V specification. -These extensions can be enabled using the ``-spirv-extensions`` option -followed by the name of the extension(s) you wish to enable. Below is a -list of supported SPIR-V extensions, sorted alphabetically by their extension names: +The enabled extensions can be controlled using the ``-spirv-ext`` option followed by a list of +extensions to enable or disable, each prefixed with ``+`` or ``-``, respectively. + +To enable multiple extensions, list them separated by comma. For example, to enable support for atomic operations on floating-point numbers and arbitrary precision integers, use: + +``-spirv-ext=+SPV_EXT_shader_atomic_float_add,+SPV_INTEL_arbitrary_precision_integers`` + +To enable all extensions, use the following option: +``-spirv-ext=all`` + +To enable all extensions except specified, specify ``all`` followed by a list of disallowed extensions. For example: +``-spirv-ext=all,-SPV_INTEL_arbitrary_precision_integers`` + +Below is a list of supported SPIR-V extensions, sorted alphabetically by their extension names: .. list-table:: Supported SPIR-V Extensions :widths: 50 150 @@ -220,16 +231,6 @@ list of supported SPIR-V extensions, sorted alphabetically by their extension na * - ``SPV_KHR_float_controls2`` - Adds ability to specify the floating-point environment in shaders. It can be used on whole modules and individual instructions. -To enable multiple extensions, list them separated by comma. For example, to enable support for atomic operations on floating-point numbers and arbitrary precision integers, use: - -``-spirv-ext=+SPV_EXT_shader_atomic_float_add,+SPV_INTEL_arbitrary_precision_integers`` - -To enable all extensions, use the following option: -``-spirv-ext=all`` - -To enable all extensions except specified, specify ``all`` followed by a list of disallowed extensions. For example: -``-spirv-ext=all,-SPV_INTEL_arbitrary_precision_integers`` - SPIR-V representation in LLVM IR ================================ From 1b10bdf158fcc44ac30703f93dac5add4d0ac309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Fri, 1 Aug 2025 09:15:04 +0200 Subject: [PATCH 2/3] Add an example on how to enable khronos extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nathan Gauër --- llvm/docs/SPIRVUsage.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/docs/SPIRVUsage.rst b/llvm/docs/SPIRVUsage.rst index 1e7ff420c60a2..78ce3d6d1699a 100644 --- a/llvm/docs/SPIRVUsage.rst +++ b/llvm/docs/SPIRVUsage.rst @@ -140,6 +140,8 @@ To enable multiple extensions, list them separated by comma. For example, to ena To enable all extensions, use the following option: ``-spirv-ext=all`` +To enable all KHR extensions, use the following option: +``-spirv-ext=khr`` To enable all extensions except specified, specify ``all`` followed by a list of disallowed extensions. For example: ``-spirv-ext=all,-SPV_INTEL_arbitrary_precision_integers`` From 427ef0a24b3cedfd507515cf64779c7b154d1dc8 Mon Sep 17 00:00:00 2001 From: Gergely Meszaros Date: Fri, 1 Aug 2025 00:21:01 -0700 Subject: [PATCH 3/3] Add blank line to correctly format. reStructuredText requires blank lines to make a new paragraph. Otherwise the text will be rendered as a continuation of the previous paragraph, with no line break. --- llvm/docs/SPIRVUsage.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/docs/SPIRVUsage.rst b/llvm/docs/SPIRVUsage.rst index 78ce3d6d1699a..fdefc53b32aba 100644 --- a/llvm/docs/SPIRVUsage.rst +++ b/llvm/docs/SPIRVUsage.rst @@ -140,6 +140,7 @@ To enable multiple extensions, list them separated by comma. For example, to ena To enable all extensions, use the following option: ``-spirv-ext=all`` + To enable all KHR extensions, use the following option: ``-spirv-ext=khr``