[all-commits] [llvm/llvm-project] b30d87: [mlir][spirv] Add basic definitions for supporting...

Lei Zhang via All-commits all-commits at lists.llvm.org
Fri Dec 27 13:26:41 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b30d87a90ba983d76f8a6cd334ac38244bbf9ded
      https://github.com/llvm/llvm-project/commit/b30d87a90ba983d76f8a6cd334ac38244bbf9ded
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2019-12-27 (Fri, 27 Dec 2019)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt
    M mlir/include/mlir/Dialect/SPIRV/SPIRVAtomicOps.td
    A mlir/include/mlir/Dialect/SPIRV/SPIRVAvailability.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVNonUniformOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
    M mlir/lib/Dialect/SPIRV/CMakeLists.txt
    M mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
    M mlir/test/CMakeLists.txt
    A mlir/test/Dialect/CMakeLists.txt
    A mlir/test/Dialect/SPIRV/CMakeLists.txt
    A mlir/test/Dialect/SPIRV/TestAvailability.cpp
    A mlir/test/Dialect/SPIRV/availability.mlir
    M mlir/tools/mlir-opt/CMakeLists.txt
    M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

  Log Message:
  -----------
  [mlir][spirv] Add basic definitions for supporting availability

SPIR-V has a few mechanisms to control op availability: version,
extension, and capabilities. These mechanisms are considered as
different availability classes.

This commit introduces basic definitions for modelling SPIR-V
availability classes. Specifically, an `Availability` class is
added to SPIRVBase.td, along with two subclasses: MinVersion
and MaxVersion for versioning. SPV_Op is extended to take a
list of `Availability`. Each `Availability` instance carries
information for generating op interfaces for the corresponding
availability class and also the concrete availability
requirements.

With the availability spec on ops, we can now auto-generate the
op interfaces of all SPIR-V availability classes and also
synthesize the op's implementations of these interfaces. The
interface generation is done via new TableGen backends
-gen-avail-interface-{decls|defs}. The op's implementation is
done via -gen-spirv-avail-impls.

Differential Revision: https://reviews.llvm.org/D71930




More information about the All-commits mailing list