[PATCH] D76244: [mlir][spirv] Make SPIRVTypeConverter target environment aware
Lei Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 16 12:01:31 PDT 2020
antiagainst created this revision.
antiagainst added a reviewer: denis13.
Herald added subscribers: llvm-commits, bader, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: mravishankar.
Herald added a project: LLVM.
antiagainst added a child revision: D76245: [mlir][spirv] Change standard op patterns to consider type conversion.
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.
Depends On D76243 <https://reviews.llvm.org/D76243>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D76244
Files:
mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h
mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
mlir/lib/Dialect/SPIRV/TargetAndABI.cpp
mlir/test/Conversion/StandardToSPIRV/std-types-to-spirv.mlir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76244.250608.patch
Type: text/x-patch
Size: 37928 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200316/8fa6c1d5/attachment-0001.bin>
More information about the llvm-commits
mailing list