[all-commits] [llvm/llvm-project] e0ea1f: [mlir][spirv] Fix capability check for 64-bit elem...

Lei Zhang via All-commits all-commits at lists.llvm.org
Wed May 25 07:58:07 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e0ea1fc6f8aa5c51061dced0f86c4fd25e3e9333
      https://github.com/llvm/llvm-project/commit/e0ea1fc6f8aa5c51061dced0f86c4fd25e3e9333
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2022-05-25 (Wed, 25 May 2022)

  Changed paths:
    M mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
    M mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
    M mlir/test/Conversion/FuncToSPIRV/types-to-spirv.mlir
    M mlir/test/Conversion/MemRefToSPIRV/alloc.mlir
    M mlir/test/Dialect/SPIRV/Transforms/vce-deduction.mlir

  Log Message:
  -----------
  [mlir][spirv] Fix capability check for 64-bit element types

Using 64-bit integer/float type in interface storage classes would
require Int64/Float64 capability, per the Vulkan spec:

```
shaderInt64 specifies whether 64-bit integers (signed and unsigned) are
supported in shader code. If this feature is not enabled, 64-bit integer
types must not be used in shader code. This also specifies whether
shader modules can declare the Int64 capability. Declaring and using
64-bit integers is enabled for all storage classes that SPIR-V allows
with the Int64 capability.
```

This is different from, say, 16-bit element types, where:

```
shaderInt16 specifies whether 16-bit integers (signed and unsigned) are
supported in shader code. If this feature is not enabled, 16-bit integer
types must not be used in shader code. This also specifies whether
shader modules can declare the Int16 capability. However, this only
enables a subset of the storage classes that SPIR-V allows for the Int16
SPIR-V capability: Declaring and using 16-bit integers in the Private,
Workgroup (for non-Block variables), and Function storage classes is
enabled, while declaring them in the interface storage classes (e.g.,
UniformConstant, Uniform, StorageBuffer, Input, Output, and
PushConstant) is not enabled.
```

Reviewed By: hanchung

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




More information about the All-commits mailing list