[mlir][spirv] Use SmallVector<ArrayRef> for availability queries
authorLei Zhang <antiagainst@google.com>
Wed, 11 Mar 2020 20:05:21 +0000 (16:05 -0400)
committerLei Zhang <antiagainst@google.com>
Thu, 12 Mar 2020 23:37:45 +0000 (19:37 -0400)
commit2ae5e472e6427795ce0efc727f3dc616c912856b
tree75549530618a27c6c009128dcb6bfc7fdca44fb2
parent3148f10b1791e3227e194b1c974bb3e83a1c4d0e
[mlir][spirv] Use SmallVector<ArrayRef> for availability queries

Previously extensions and capabilities requirements are returned as
SmallVector<SmallVector>. It's an anti-pattern; this commit improves
a bit by returning as SmallVector<ArrayRef>. This is possible because
the internal sequence is always known statically (from the spec)
so that we can use a static constant array for it and get an ArrayRef.

Differential Revision: https://reviews.llvm.org/D75874
mlir/include/mlir/Dialect/SPIRV/SPIRVAvailability.td
mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp