[Mlir-commits] [mlir] 87a2321 - [MLIR][SPIRVToLLVM] Updated documentation for composite ops

George Mitenkov llvmlistbot at llvm.org
Mon Oct 19 07:43:53 PDT 2020


Author: George Mitenkov
Date: 2020-10-19T17:43:22+03:00
New Revision: 87a232103294e2500bc44e3195b54063ca9e98f7

URL: https://github.com/llvm/llvm-project/commit/87a232103294e2500bc44e3195b54063ca9e98f7
DIFF: https://github.com/llvm/llvm-project/commit/87a232103294e2500bc44e3195b54063ca9e98f7.diff

LOG: [MLIR][SPIRVToLLVM] Updated documentation for composite ops

Added a section on composite ops (`spv.CompositeExtract` and
`spv.CompositeInsert`) conversion.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D89658

Added: 
    

Modified: 
    mlir/docs/SPIRVToLLVMDialectConversion.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/SPIRVToLLVMDialectConversion.md b/mlir/docs/SPIRVToLLVMDialectConversion.md
index e5125d5301c9..8d773aa0b022 100644
--- a/mlir/docs/SPIRVToLLVMDialectConversion.md
+++ b/mlir/docs/SPIRVToLLVMDialectConversion.md
@@ -352,6 +352,20 @@ SPIR-V Dialect op                     | LLVM Dialect op
 `spv.ULessThan`                       | `llvm.icmp "ult"`
 `spv.ULessThanEqual`                  | `llvm.icmp "ule"`
 
+### Composite ops
+
+Currently, conversion supports rewrite patterns for `spv.CompositeExtract` and
+`spv.CompositeInsert`. We distinguish two cases for these operations: when the
+composite object is a vector, and when the composite object is of a non-vector
+type (*i.e.* struct, array or runtime array).
+
+Composite type  | SPIR-V Dialect op      | LLVM Dialect op
+:-------------: | :--------------------: | :--------------------:
+vector          | `spv.CompositeExtract` | `llvm.extractelement`
+vector          | `spv.CompositeInsert`  | `llvm.insertelement`
+non-vector      | `spv.CompositeExtract` | `llvm.extractvalue`
+non-vector      | `spv.CompositeInsert`  | `llvm.insertvalue`
+
 ### `spv.EntryPoint` and `spv.ExecutionMode`
 
 **Note: these conversions are likely to be changed in the future**
@@ -597,8 +611,6 @@ There is no support of the following ops:
 As well as:
 
 *   spv.CompositeConstruct
-*   spv.CompositeExtract
-*   spv.CompositeInsert
 *   spv.ControlBarrier
 *   spv.CopyMemory
 *   spv.FMod


        


More information about the Mlir-commits mailing list