Skip to content

Commit 8939767

Browse files
dmitryryinteligcbot
authored andcommitted
Move KernelInfo to GenX Utils library
KernelInfo and InternalMetadata sources are now part of GenX Utils library. The namespace was switched from llvm::genx to vc.
1 parent 9c3307d commit 8939767

36 files changed

+323
-323
lines changed

IGC/VectorCompiler/include/vc/GenXCodeGen/GenXOCLRuntimeInfo.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ SPDX-License-Identifier: MIT
99
#ifndef VCOPT_LIB_GENXCODEGEN_GENXOCLRUNTIMEINFO_H
1010
#define VCOPT_LIB_GENXCODEGEN_GENXOCLRUNTIMEINFO_H
1111

12-
#include "vc/GenXOpts/Utils/KernelInfo.h"
1312
#include "vc/Support/BackendConfig.h"
13+
#include "vc/Utils/GenX/KernelInfo.h"
1414

1515
#include "llvm/ADT/Optional.h"
1616
#include "llvm/Pass.h"
@@ -185,10 +185,9 @@ class GenXOCLRuntimeInfo : public ModulePass {
185185
private:
186186
void setInstructionUsageProperties(const FunctionGroup &FG,
187187
const GenXBackendConfig &BC);
188-
void setMetadataProperties(genx::KernelMetadata &KM,
189-
const GenXSubtarget &ST);
188+
void setMetadataProperties(vc::KernelMetadata &KM, const GenXSubtarget &ST);
190189
void setArgumentProperties(const Function &Kernel,
191-
const genx::KernelMetadata &KM,
190+
const vc::KernelMetadata &KM,
192191
const GenXSubtarget &ST,
193192
const GenXBackendConfig &BC);
194193
void setPrintStrings(const Module &KernelModule);

IGC/VectorCompiler/include/vc/GenXOpts/Utils/InternalMetadata.h renamed to IGC/VectorCompiler/include/vc/Utils/GenX/InternalMetadata.h

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ SPDX-License-Identifier: MIT
66
77
============================= end_copyright_notice ===========================*/
88

9-
#ifndef VC_GENXOPTS_UTILS_INTERNALMETADATA_H
10-
#define VC_GENXOPTS_UTILS_INTERNALMETADATA_H
11-
12-
#include "llvm/IR/Function.h"
9+
#ifndef VC_UTILS_GENX_INTERNALMETADATA_H
10+
#define VC_UTILS_GENX_INTERNALMETADATA_H
1311

1412
namespace llvm {
15-
namespace genx {
13+
class Function;
14+
} // namespace llvm
15+
16+
namespace vc {
1617

1718
namespace VariableMD {
1819
inline constexpr const char VCPredefinedVariable[] = "VCPredefinedVariable";
@@ -26,7 +27,7 @@ inline constexpr const char VCEmulationRoutine[] = "VC.Emulation.Routine";
2627
// no attribute means that GenXStackUsage pass failed (recursion, etc)
2728
// attribute created by GenXStackUsage and used to create patch token
2829
inline constexpr const char VCStackAmount[] = "VC.Stack.Amount";
29-
}
30+
} // namespace FunctionMD
3031

3132
namespace InstMD {
3233
// SVMBlockType metadata serves interesting purpose:
@@ -38,7 +39,7 @@ inline constexpr const char SVMBlockType[] = "SVMBlockType";
3839
// These two are used in prologue/epilogue insertion
3940
inline constexpr const char FuncArgSize[] = "FuncArgSize";
4041
inline constexpr const char FuncRetSize[] = "FuncRetSize";
41-
}
42+
} // namespace InstMD
4243

4344
namespace internal {
4445

@@ -54,28 +55,19 @@ enum {
5455
};
5556
}
5657
namespace ArgLinearizationMDOp {
57-
enum {
58-
Explicit,
59-
Linearization,
60-
Last
61-
};
58+
enum { Explicit, Linearization, Last };
6259
}
6360
namespace LinearizationMDOp {
64-
enum {
65-
Argument,
66-
Offset,
67-
Last
68-
};
61+
enum { Argument, Offset, Last };
6962
}
7063

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

7770
} // namespace internal
78-
} // namespace genx
79-
} // namespace llvm
71+
} // namespace vc
8072

81-
#endif // VC_GENXOPTS_UTILS_INTERNALMETADATA_H
73+
#endif // VC_UTILS_GENX_INTERNALMETADATA_H

0 commit comments

Comments
 (0)