llvm-project/mlir/test/Conversion/SPIRVToLLVM
ergawy bddaa7a848 [MLIR][SPIRV] Support identified and recursive structs.
This PR adds support for identified and recursive structs.
This includes: parsing, printing, serializing, and
deserializing such structs.

The following C struct:

```C
struct A {
  A* next;
};
```

which is translated to the following MLIR code as:

```mlir
!spv.struct<A, (!spv.ptr<!spv.struct<A>, Generic>)>
```

would be represented in the SPIR-V module as:

```spirv
OpName %A "A"
OpTypeForwardPointer %APtr Generic
%A = OpTypeStruct %APtr
%APtr = OpTypePointer Generic %A
```

In particular the following changes are included:
- SPIR-V structs can now be either identified or literal
  (i.e. non-identified).
- All structs now have their members surrounded by a ()-pair.
- For recursive references,
  (1) an OpTypeForwardPointer instruction is emitted before
  the OpTypeStruct instruction defining the recursive struct
  (2) an OpTypePointer instruction is emitted after the
  OpTypeStruct instruction which actually defines the recursive
  pointer to struct type.

Reviewed By: antiagainst, rriddle, ftynse

Differential Revision: https://reviews.llvm.org/D87206
2020-10-13 10:18:21 -04:00
..
arithmetic-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
bitwise-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
cast-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
comparison-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
constant-op-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
control-flow-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Conversion pattern for loop op 2020-08-05 10:33:54 +03:00
func-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
glsl-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
logical-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
memory-ops-to-llvm.mlir [MLIR][SPIRV] Support identified and recursive structs. 2020-10-13 10:18:21 -04:00
misc-ops-to-llvm.mlir [MLIR][SPIRV] Support identified and recursive structs. 2020-10-13 10:18:21 -04:00
module-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Implementation of SPIR-V module conversion pattern 2020-06-24 20:42:50 -04:00
shift-ops-to-llvm.mlir [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion 2020-08-21 00:26:33 +03:00
spirv-types-to-llvm-invalid.mlir [MLIR][SPIRV] Support identified and recursive structs. 2020-10-13 10:18:21 -04:00
spirv-types-to-llvm.mlir [MLIR][SPIRV] Support identified and recursive structs. 2020-10-13 10:18:21 -04:00