[llvm] [SPIR-V] Implement SPV_KHR_float_controls2 (PR #146941)
Marcos Maronas via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 8 04:14:14 PDT 2025
================
@@ -589,3 +589,30 @@ Group and Subgroup Operations
For workgroup and subgroup operations, LLVM uses function calls to represent SPIR-V's
group-based instructions. These builtins facilitate group synchronization, data sharing,
and collective operations essential for efficient parallel computation.
+
+SPIR-V Instructions Mapped to LLVM Metadata
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Some SPIR-V instructions don't have a direct equivalent in the LLVM IR language. To
+address this, the SPIR-V Target uses different specific LLVM named metadata to convey
+the necessary information. The SPIR-V specification allows multiple module-scope
+instructions, where as LLVM named metadata must be unique. Therefore, the encoding of
+such instructions has the following format:
+
+.. code-block:: llvm
+
+ !spirv.<OpCodeName> = !{!<InstructionMetadata1>, !<InstructionMetadata2>, ..}
+ !<InstructionMetadata1> = !{<Operand1>, <Operand2>, ..}
+ !<InstructionMetadata2> = !{<Operand1>, <Operand2>, ..}
+
+Below, you will find the mappings between SPIR-V instruction and their corresponding
+LLVM IR representations.
++--------------------+---------------------------------------------------------+
----------------
maarquitos14 wrote:
Done in https://github.com/llvm/llvm-project/pull/146941/commits/f2aefbf502e6a48a5f8b251bdfbeb7ed8d412041.
https://github.com/llvm/llvm-project/pull/146941
More information about the llvm-commits
mailing list