File: InternalMetadata.h

package info (click to toggle)
intel-graphics-compiler2 2.18.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 107,080 kB
  • sloc: cpp: 807,289; lisp: 287,855; ansic: 16,414; python: 4,004; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 35
file content (77 lines) | stat: -rw-r--r-- 2,572 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*========================== begin_copyright_notice ============================

Copyright (C) 2021-2025 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/

#ifndef VC_UTILS_GENX_INTERNALMETADATA_H
#define VC_UTILS_GENX_INTERNALMETADATA_H

namespace llvm {
class Function;
} // namespace llvm

namespace vc {

namespace FunctionMD {
inline constexpr const char GenXKernelInternal[] = "genx.kernel.internal";
inline constexpr const char VCBuiltinFunction[] = "VC.Builtin";
inline constexpr const char VCDisableMidThreadPreemption[] =
    "vc.disable.mid.thread.preemption";

// amount of stack calculated for kernel
// no attribute means that GenXStackUsage pass failed (recursion, etc)
// attribute created by GenXStackUsage and used to create patch token
inline constexpr const char VCStackAmount[] = "VC.Stack.Amount";

inline constexpr const char VCSimdCFArg[] = "VC.SimdCFArg";
inline constexpr const char VCSimdCFRet[] = "VC.SimdCFRet";
} // namespace FunctionMD

namespace InstMD {
// SVMBlockType metadata serves interesting purpose:
//   Finalizer now don't support properly SVM gathers/scatters less then dword
//   So we are extending everything to 32 but preserving real type in metadata
//   To use it later in CISA builder when we are creating gather/scatter
inline constexpr const char SVMBlockType[] = "SVMBlockType";

// These two are used in prologue/epilogue insertion
// In units of GRFs.
inline constexpr const char FuncArgSize[] = "FuncArgSize";
inline constexpr const char FuncRetSize[] = "FuncRetSize";
} // namespace InstMD

namespace internal {

namespace KernelMDOp {
enum {
  FunctionRef,
  OffsetInArgs, // Implicit arguments offset in the byval argument
  ArgIndexes,   // Kernel argument index. Index may not be equal to the IR argNo
                // in the case of linearization
  LinearizationArgs,
  BTIndices,
  Last,                 // Last mandatory operand
  IndirectCount = Last, // Indirect stateless access count
  LastOptional,
};
}
namespace ArgLinearizationMDOp {
enum { Explicit, Linearization, Last };
}
namespace LinearizationMDOp {
enum { Argument, Offset, Last };
}

// ExternalMD is created by vc-intrinsics. Internal has to be created by VC BE.
// This creates initial internal metadata structure. Definition in
// KernelInfo.cpp
void createInternalMD(llvm::Function &F);
void replaceInternalFunctionRef(const llvm::Function &From, llvm::Function &To);

} // namespace internal
} // namespace vc

#endif // VC_UTILS_GENX_INTERNALMETADATA_H