[MLIR][SPIRVToLLVM] Convert spv.constant scalars and vectors
authorGeorge Mitenkov <georgemitenk0v@gmail.com>
Thu, 2 Jul 2020 18:21:35 +0000 (14:21 -0400)
committerLei Zhang <antiagainst@google.com>
Thu, 2 Jul 2020 18:26:58 +0000 (14:26 -0400)
commit1cfaaf645528cc2fed79617c8ca80945a1504021
tree3aa0a3ccd23025cf9b73602fc7aec3e294dc8622
parent5416fc014ae5590fdef89630f3777d3216879fbb
[MLIR][SPIRVToLLVM] Convert spv.constant scalars and vectors

This patch introduces conversion pattern for `spv.constant` with scalar
and vector types. There is a special case when the constant value is a
signed/unsigned integer (vector of integers). Since LLVM dialect does not
have signedness semantics, the types had to be converted to signless ints.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D82936
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
mlir/test/Conversion/SPIRVToLLVM/constant-op-to-llvm.mlir [new file with mode: 0644]