[all-commits] [llvm/llvm-project] 3b35f9: [mlir][spirv] Use memref memory space for storage ...

Lei Zhang via All-commits all-commits at lists.llvm.org
Wed Mar 18 17:13:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b35f9d8b51018c0a4301c0d7a5b81bbe33863ee
      https://github.com/llvm/llvm-project/commit/3b35f9d8b51018c0a4301c0d7a5b81bbe33863ee
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h
    M mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
    M mlir/include/mlir/Dialect/SPIRV/TargetAndABI.td
    M mlir/include/mlir/IR/Types.h
    M mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
    M mlir/lib/Dialect/SPIRV/TargetAndABI.cpp
    M mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
    M mlir/lib/IR/StandardTypes.cpp
    M mlir/test/Conversion/GPUToSPIRV/load-store.mlir
    M mlir/test/Conversion/GPUToSPIRV/simple.mlir
    M mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir
    A mlir/test/Dialect/SPIRV/Transforms/abi-interface.mlir
    M mlir/test/Dialect/SPIRV/Transforms/abi-load-store.mlir
    R mlir/test/Dialect/SPIRV/Transforms/abi-simple.mlir
    M mlir/test/Dialect/SPIRV/target-and-abi.mlir

  Log Message:
  -----------
  [mlir][spirv] Use memref memory space for storage class

Previously in SPIRVTypeConverter, we always convert memref types
to StorageBuffer regardless of their memory spaces. This commit
fixes that to let the conversion to look into memory space
properly. For this purpose, a mapping between SPIR-V storage class
and memref memory space is introduced. The mapping is arbitary
decided at the moment and the hope is that we can leverage
string memory space later to be more clear.

Now spv.interface_var_abi cannot contain storage class unless it's
attached to a scalar value, where we need the storage class as side
channel information. Verifications and tests are properly adjusted.

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


  Commit: 67e8690e53c341ba433f9c2de3f5a16b8beb7f0b
      https://github.com/llvm/llvm-project/commit/67e8690e53c341ba433f9c2de3f5a16b8beb7f0b
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
    M mlir/test/Conversion/GPUToSPIRV/if.mlir
    M mlir/test/Conversion/GPUToSPIRV/load-store.mlir
    M mlir/test/Conversion/GPUToSPIRV/loop.mlir
    M mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir
    M mlir/test/Conversion/StandardToSPIRV/subview-to-spirv.mlir

  Log Message:
  -----------
  [mlir][spirv] Let SPIRVConversionTarget consider type availability

Previously we only consider the version/extension/capability requirement
on the op itself. This commit updates SPIRVConversionTarget to also
take into consideration the values' types when deciding op legality.

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


  Commit: 58df5e6d9ad93041d9c9b53a9e24d2be79796762
      https://github.com/llvm/llvm-project/commit/58df5e6d9ad93041d9c9b53a9e24d2be79796762
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h
    M mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
    M mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
    M mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.cpp
    M mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
    M mlir/lib/Dialect/SPIRV/TargetAndABI.cpp
    M mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
    M mlir/lib/Dialect/SPIRV/Transforms/UpdateVCEPass.cpp
    M mlir/test/Dialect/SPIRV/Transforms/abi-interface.mlir
    M mlir/test/Dialect/SPIRV/Transforms/abi-load-store.mlir
    M mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp

  Log Message:
  -----------
  [mlir][spirv] Plumbing target environment into type converter

This commit unifies target environment queries into a new wrapper
class spirv::TargetEnv and shares across various places needing
the functionality. We still create multiple instances of TargetEnv
though given the parent components (type converters, passes,
conversion targets) have different lifetimes.

In the meantime, LowerABIAttributesPass is updated to take into
consideration the target environment, which requires updates to
tests to provide that.

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


  Commit: f741b8eabed393a559459c8af024014580170d17
      https://github.com/llvm/llvm-project/commit/f741b8eabed393a559459c8af024014580170d17
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
    M mlir/lib/Dialect/SPIRV/LayoutUtils.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVCanonicalization.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
    M mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp

  Log Message:
  -----------
  [mlir][spirv] Move type checks from dialect class to type hierarchy

Types should be checked with the type hierarchy. This should result in
better responsibility division and API surface.

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


  Commit: 9efb4b4023272c46e10738c96936710d3ed70d5a
      https://github.com/llvm/llvm-project/commit/9efb4b4023272c46e10738c96936710d3ed70d5a
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h
    M mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
    M mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
    M mlir/lib/Dialect/SPIRV/TargetAndABI.cpp
    A mlir/test/Conversion/StandardToSPIRV/std-types-to-spirv.mlir

  Log Message:
  -----------
  [mlir][spirv] Make SPIRVTypeConverter target environment aware

Non-32-bit scalar types requires special hardware support that may
not exist on all Vulkan-capable GPUs. This is reflected as non-32-bit
scalar types require special capabilities or extensions to be used.
This commit makes SPIRVTypeConverter target environment aware so
that it can properly convert standard types to what is accepted on
the target environment.

Right now if a scalar type bitwidth is not supported in the target
environment, we use 32-bit unconditionally. This requires Vulkan
runtime to also feed in data with a matched bitwidth and layout,
especially for interface types. The Vulkan runtime can do that by
inspecting the SPIR-V module. Longer term, we might want to introduce
a way to control how such case are handled and explicitly fail
if wanted.

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


  Commit: ffd4583c6aee0d6ca62efe962d6f2cb15de8bdab
      https://github.com/llvm/llvm-project/commit/ffd4583c6aee0d6ca62efe962d6f2cb15de8bdab
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
    M mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
    M mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir
    M mlir/test/Conversion/StandardToSPIRV/std-types-to-spirv.mlir

  Log Message:
  -----------
  [mlir][spirv] Change standard op patterns to consider type conversion

Previously we have a few patterns that were written with DRR. DRR
at the moment does not work nicely with dialect conversion framework.
It generates normal RewritePatterns, while the dialect conversion
framework requires ConversionPatterns to take into consideration
the type conversion. So this commit starts to change existing DRR
patterns for standard ops to OpConversionPattern to incorporate the
SPIR-V type conversion. All patterns are converted except the one
for constant ops, which will happen in a subsequent commit.

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


  Commit: 73431a492badf1b01ac4c60e193d7e7374bb63ff
      https://github.com/llvm/llvm-project/commit/73431a492badf1b01ac4c60e193d7e7374bb63ff
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
    M mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
    R mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
    M mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir

  Log Message:
  -----------
  [mlir][spirv] Consolidate std.constant to spv.constant conversions

This commit merges the DRR pattern for std.constant to spv.constant
conversion into the C++ OpConversionPattern. This allows us to have
remove the DRR pattern file. Along the way, this commit enhanced
std.constant to spv.constant conversion to consider type conversions,
which means converting the underlying attributes if necessary.

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


Compare: https://github.com/llvm/llvm-project/compare/c69a4d6bef0a...73431a492bad


More information about the All-commits mailing list