
Option to express that `spirv` StorageClasses should be mapped to LLVM
address spaces in the conversion process. This mapping will be
client-dependent.
The client API cannot be taken from the code as more than one module
could be present, resulting in more than one VCE triple and different
StorageClass to address space mappings. This information would not be
available during type conversion.
A specific mapping for the OpenCL client is defined, based on [the
OpenCL Extended Instruction
Set](https://registry.khronos.org/SPIR-V/specs/unified1/OpenCL.ExtendedInstructionSet.100.html#_binary_form)
and [this
mapping](3edd338a64/clang/lib/Basic/Targets/SPIR.h (L27)
).
Signed-off-by: Victor Perez <victor.perez@codeplay.com>
Reviewed By: antiagainst, kuhar
Differential Revision: https://reviews.llvm.org/D158627
6 lines
345 B
MLIR
6 lines
345 B
MLIR
// RUN: mlir-opt -convert-spirv-to-llvm='client-api=Metal' -verify-diagnostics %s
|
|
// RUN: mlir-opt -convert-spirv-to-llvm='client-api=Vulkan' -verify-diagnostics %s
|
|
// RUN: mlir-opt -convert-spirv-to-llvm='client-api=WebGPU' -verify-diagnostics %s
|
|
|
|
module {} // expected-warning-re {{address space mapping for client '{{.*}}' not implemented}}
|