[mlir][StandardToSPIRV] Handle conversion of cmpi operation with i1
authorMaheshRavishankar <ravishankarm@google.com>
Wed, 29 Apr 2020 16:57:31 +0000 (09:57 -0700)
committerMaheshRavishankar <ravishankarm@google.com>
Wed, 29 Apr 2020 17:09:03 +0000 (10:09 -0700)
commit1c12a95d9c52de8980ea9979350c7eabc1b9fd01
tree6756c20d283e67896dbc5419d145ad4ff0209314
parentdcdb1b94e1f175e1c70a6a46c7f6d0925a3e6e07
[mlir][StandardToSPIRV] Handle conversion of cmpi operation with i1
type operands.

The instructions used to convert std.cmpi cannot have i1 types
according to SPIR-V specification. A different set of operations are
specified in the SPIR-V spec for comparing boolean types. Enhance the
StandardToSPIRV lowering to target these instructions when operands to
std.cmpi operation are of i1 type.

Differential Revision: https://reviews.llvm.org/D79049
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
mlir/test/Conversion/StandardToSPIRV/std-ops-to-spirv.mlir