[MLIR][SPIRVToLLVM] Convert bitwise and logical not
authorGeorge Mitenkov <georgemitenk0v@gmail.com>
Mon, 29 Jun 2020 23:16:36 +0000 (19:16 -0400)
committerLei Zhang <antiagainst@google.com>
Mon, 29 Jun 2020 23:16:50 +0000 (19:16 -0400)
commitcd1bc5c15d4e58b574060c844917c8dfeb7a8f54
treee40d0cba90d6e76c7785908a47cf865684963475
parent782585a2144e2af019bd3e4dc48cab611545645b
[MLIR][SPIRVToLLVM] Convert bitwise and logical not

This patch introduces new conversion patterns for bit and logical
negation op: `spv.Not` and `spv.LogicalNot`. They are implemented
by applying xor on the operand and mask with all bits set.

Differential Revision: https://reviews.llvm.org/D82637
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
mlir/test/Conversion/SPIRVToLLVM/logical-to-llvm.mlir