1 //===- AttrToSPIRVConverter.cpp - GPU attributes conversion to SPIR-V - C++===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include <mlir/Conversion/GPUCommon/AttrToSPIRVConverter.h>
12 spirv::StorageClass
addressSpaceToStorageClass(gpu::AddressSpace addressSpace
) {
13 switch (addressSpace
) {
14 case gpu::AddressSpace::Global
:
15 return spirv::StorageClass::CrossWorkgroup
;
16 case gpu::AddressSpace::Workgroup
:
17 return spirv::StorageClass::Workgroup
;
18 case gpu::AddressSpace::Private
:
19 return spirv::StorageClass::Private
;
21 llvm_unreachable("Unhandled storage class");