[spirv] Basic validity of SPV_ModuleOp
authorLei Zhang <antiagainst@google.com>
Tue, 4 Jun 2019 21:03:30 +0000 (14:03 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 9 Jun 2019 23:17:34 +0000 (16:17 -0700)
commit23cf3b39e0a88975039fb173eb3befd46e13fe60
tree6f22e447d0d242245dad0cdca6195688299c28c1
parent11d18a4a5e0b9d242722b2c57660ce34b52cb517
[spirv] Basic validity of SPV_ModuleOp

This CL adds SPV_ModuleEndOp for terminating the only block inside a
SPV_ModuleOp's only region. Verification now enforces a spv.module only
contains func or spv.* ops and no external or nested functions are
present. Because of the structural requirement of a block, spv.Return
is also added in this CL.

PiperOrigin-RevId: 251510706
mlir/include/mlir/SPIRV/SPIRVOps.td
mlir/include/mlir/SPIRV/SPIRVStructureOps.td
mlir/lib/SPIRV/SPIRVOps.cpp
mlir/test/SPIRV/ops.mlir
mlir/test/SPIRV/structure-ops.mlir