Skip to content
Commit 12ce9fd1 authored by Victor Perez's avatar Victor Perez
Browse files

[mlir][spirv] Add client-api option to -convert-spirv-to-llvm

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](https://github.com/llvm/llvm-project/blob/3edd338a6407d9410f6a283c5dc32ba676ac0b8f/clang/lib/Basic/Targets/SPIR.h#L27

).

Signed-off-by: default avatarVictor Perez <victor.perez@codeplay.com>

Reviewed By: antiagainst, kuhar

Differential Revision: https://reviews.llvm.org/D158627
parent 0e63f1aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment