[MLIR][SPIRVToLLVM] Conversion for bitrverse and bitcount ops
authorGeorge Mitenkov <georgemitenk0v@gmail.com>
Fri, 26 Jun 2020 14:29:05 +0000 (10:29 -0400)
committerLei Zhang <antiagainst@google.com>
Fri, 26 Jun 2020 14:30:52 +0000 (10:30 -0400)
commitc8295de4a66adcc610c315df69286f02c306a1c9
treed6abdd9a48d9fe387dac37d6ac035ab1bc7631c4
parent056a539e570a49e27f88f4555d42f00be0500749
[MLIR][SPIRVToLLVM] Conversion for bitrverse and bitcount ops

Implemented conversion for `spv.BitReverse` and `spv.BitCount`. Since ODS
generates builders in a different way for LLVM dialect intrinsics, I
added attributes to build method in `DirectConversionPattern` class. The
tests for these ops are in `bitwise-ops-to-llvm.mlir`.

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