[MLIR][SPIRVToLLVM] Updated documentation for composite ops
authorGeorge Mitenkov <georgemitenk0v@gmail.com>
Mon, 19 Oct 2020 14:20:11 +0000 (17:20 +0300)
committerGeorge Mitenkov <georgemitenk0v@gmail.com>
Mon, 19 Oct 2020 14:43:22 +0000 (17:43 +0300)
Added a section on composite ops (`spv.CompositeExtract` and
`spv.CompositeInsert`) conversion.

Reviewed By: antiagainst

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

mlir/docs/SPIRVToLLVMDialectConversion.md

index e5125d5..8d773aa 100644 (file)
@@ -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