LLVM 24.0.0git
PISAAddrSpace.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file defines the address spaces used by the PISA target.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_SUPPORT_PISAADDRSPACE_H
15#define LLVM_SUPPORT_PISAADDRSPACE_H
16
17namespace llvm {
18
19namespace PISAAS {
20// See the PISA address-space specification:
21// https://intel.github.io/pisa/spaces_types.html#address-spaces
22enum class AddressSpace : unsigned {
24 GLOBAL = 1,
26 SHARED = 3,
28};
29
30// DWARFAddressSpace for PISA, this will be emitted as DW_AT_address_class
31// attribute for variables and parameters.
37
38constexpr int mapToDWARFAddrSpace(unsigned LLVMAddrSpace) {
39 int dwarfAddrSpace = -1;
40
41 switch (static_cast<AddressSpace>(LLVMAddrSpace)) {
43 dwarfAddrSpace = static_cast<int>(DWARF_AddressSpace::DWARF_ADDR_private);
44 break;
47 dwarfAddrSpace =
49 break;
51 dwarfAddrSpace =
53 break;
54 default:
55 // default is generic space, do not emit anything
56 break;
57 }
58
59 return dwarfAddrSpace;
60}
61
62} // end namespace PISAAS
63
64} // end namespace llvm
65
66#endif // LLVM_SUPPORT_PISAADDRSPACE_H
constexpr int mapToDWARFAddrSpace(unsigned LLVMAddrSpace)
This is an optimization pass for GlobalISel generic memory operations.