llvm-project/mlir/test/Target/SPIRV
Lei Zhang 5e55a20119 [mlir][spirv] Serialize selection with separate header block
The previous "optimization" that tries to reuse existing block for
selection header block can be problematic for deserialization
because it effectively pulls in previous ops in the selection op's
enclosing block into the selection op's header. When deserializing,
those ops will be placed in the selection op's region. If any of
the previous ops has usage after the section op, it will break. That
is, the following IR cannot round trip:

```mlir
^bb:
  %def = ...
  spv.mlir.selection { ... }
  %use = spv.SomeOp %def
```

This commit removes the "optimization" to always create new blocks
for the selection header.

Along the way, also made error reporting better in deserialization
by turning asserts into proper errors and add check of uses outside
of sinked structured control flow region blocks.

Reviewed By: Hardcode84

Differential Revision: https://reviews.llvm.org/D115582
2021-12-13 10:42:26 -05:00
..
arithmetic-ops.mlir
array.mlir [MLIR][SPIRV] Rename `spv.globalVariable` to `spv.GlobalVariable`. 2021-03-04 16:24:59 -05:00
atomic-ops.mlir [mlir][spirv] add AtomicFAddEXTOp 2021-11-16 14:24:22 +03:00
barrier-ops.mlir [mlir][OpFormatGen] Format enum attribute cases as keywords when possible 2021-01-14 11:35:49 -08:00
bit-ops.mlir
cast-ops.mlir
composite-op.mlir [mlir][spirv] Define sp.VectorShuffle 2021-02-02 11:08:56 -05:00
constant.mlir [mlir][spirv] Add support for i8 serialization 2021-07-30 18:06:11 -04:00
cooperative-matrix-ops.mlir [MLIR][SPIRV] Rename `spv.constant` to `spv.Constant`. 2021-03-04 16:15:56 -05:00
debug.mlir [MLIR][SPIRV] Rename `spv.selection` to `spv.mlir.selection`. 2021-03-06 16:05:31 +01:00
decorations.mlir [mlir][SPIRVToLLVM] Propagate location attribute from spv.GlobalVariable to llvm.mlir.global 2021-10-05 00:09:09 +08:00
entry-point.mlir [MLIR][SPIRV] Rename `spv.globalVariable` to `spv.GlobalVariable`. 2021-03-04 16:24:59 -05:00
execution-mode.mlir
function-call.mlir [MLIR][SPIRV] Rename `spv.loop` to `spv.mlir.loop`. 2021-03-05 15:44:30 -05:00
global-variable.mlir [MLIR][SPIRV] Rename `spv.globalVariable` to `spv.GlobalVariable`. 2021-03-04 16:24:59 -05:00
glsl-ops.mlir [mlir][spirv] Add ops and patterns for lowering standard max/min ops 2021-10-05 14:27:32 -04:00
group-ops.mlir [mlir][OpFormatGen] Format enum attribute cases as keywords when possible 2021-01-14 11:35:49 -08:00
image-ops.mlir [mlir][spirv] Define spv.ImageQuerySize operation 2021-05-13 13:17:08 -04:00
image.mlir [MLIR][SPIRV] Rename `spv.globalVariable` to `spv.GlobalVariable`. 2021-03-04 16:24:59 -05:00
logical-ops.mlir [MLIR][SPIRV] Rename `spv.constant` to `spv.Constant`. 2021-03-04 16:15:56 -05:00
loop.mlir [mlir][spirv] Serialize selection with separate header block 2021-12-13 10:42:26 -05:00
matrix.mlir [MLIR][SPIRV] Rename `spv.globalVariable` to `spv.GlobalVariable`. 2021-03-04 16:24:59 -05:00
memory-ops.mlir [MLIR][SPIRV] Rename `spv.constant` to `spv.Constant`. 2021-03-04 16:15:56 -05:00
module.mlir
non-uniform-ops.mlir [MLIR][SPIRV] Rename `spv.constant` to `spv.Constant`. 2021-03-04 16:15:56 -05:00
ocl-ops.mlir [mlir][spirv] math.erf OpenCL lowering 2021-12-08 21:59:46 +03:00
phi.mlir [MLIR][SPIRV] Properly (de-)serialize BranchConditionalOp. 2021-05-07 09:00:50 +02:00
sampled-image.mlir [MLIR][SPIRV] Rename `spv.globalVariable` to `spv.GlobalVariable`. 2021-03-04 16:24:59 -05:00
selection.mlir [mlir][spirv] Serialize selection with separate header block 2021-12-13 10:42:26 -05:00
spec-constant.mlir [MLIR][SPIRV] Rename `spv.constant` to `spv.Constant`. 2021-03-04 16:15:56 -05:00
struct.mlir [MLIR][SPIRV] Rename `spv.globalVariable` to `spv.GlobalVariable`. 2021-03-04 16:24:59 -05:00
terminator.mlir
undef.mlir [MLIR][SPIRV] Rename `spv.undef` to `spv.Undef`. 2021-03-05 15:49:44 -05:00