[spirv] Fix bitwidth emulation for Workgroup storage class
authorLei Zhang <antiagainst@google.com>
Wed, 5 Aug 2020 14:06:00 +0000 (10:06 -0400)
committerLei Zhang <antiagainst@google.com>
Wed, 5 Aug 2020 18:44:03 +0000 (14:44 -0400)
commit48378a32af54af6ae656a3db14dc7c0d975d0f48
tree51f168eebd4a3f98ed4019c311bea1619a4e1e40
parentb1dac0cfcd3630c9a89bd31f9010eb8e8f099f6c
[spirv] Fix bitwidth emulation for Workgroup storage class

If Int16 is not available, 16-bit integers inside Workgroup storage
class should be emulated via 32-bit integers. This was previously
broken because the capability querying logic was incorrectly
intercepting all storage classes where it meant to only handle
interface storage classes. Adjusted where we return to fix this.

Differential Revision: https://reviews.llvm.org/D85308
mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
mlir/test/Conversion/StandardToSPIRV/alloc.mlir