Skip to content

Commit b4e2221

Browse files
scottp101igcbot
authored andcommitted
add utility and cleanup
add utility and cleanup
1 parent b0d40dc commit b4e2221

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,13 +2621,6 @@ namespace IGC
26212621
return headerSize;
26222622
}
26232623

2624-
bool DSDualPatchEnabled(class CodeGenContext* ctx)
2625-
{
2626-
return ctx->platform.supportDSDualPatchDispatch() &&
2627-
ctx->platform.WaDisableDSDualPatchMode() &&
2628-
!(ctx->m_DriverInfo.APIDisableDSDualPatchDispatch()) &&
2629-
IGC_IS_FLAG_DISABLED(DisableDSDualPatch);
2630-
}
26312624

26322625
void InsertOptsMetadata(CodeGenContext* pCtx, llvm::Function* F)
26332626
{

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,6 @@ namespace IGC
500500
unsigned int AppendConservativeRastWAHeader(IGC::SProgramOutput* program, SIMDMode simdmode);
501501
unsigned int AppendConservativeRastWAHeader(void*& pBinary, unsigned int& binarySize, SIMDMode simdmode);
502502

503-
bool DSDualPatchEnabled(class CodeGenContext* ctx);
504-
505503

506504
/// \brief Check whether inst precedes given position in one basic block
507505
inline bool isInstPrecede(

IGC/Compiler/MetaDataApi/IGCMetaDataHelper.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,26 @@ void IGCMetaDataHelper::moveFunction(
4343
}
4444
}
4545

46+
void IGCMetaDataHelper::copyFunction(
47+
MetaDataUtils& mdUtils,
48+
ModuleMetaData& MD,
49+
llvm::Function* OldFunc, llvm::Function* NewFunc)
50+
{
51+
auto oldFuncIter = mdUtils.findFunctionsInfoItem(OldFunc);
52+
if (oldFuncIter != mdUtils.end_FunctionsInfo())
53+
{
54+
mdUtils.setFunctionsInfoItem(NewFunc, oldFuncIter->second);
55+
}
56+
57+
auto& FuncMD = MD.FuncMD;
58+
auto loc = FuncMD.find(OldFunc);
59+
if (loc != FuncMD.end())
60+
{
61+
auto funcInfo = loc->second;
62+
FuncMD[NewFunc] = funcInfo;
63+
}
64+
}
65+
4666
void IGCMetaDataHelper::removeFunction(
4767
MetaDataUtils& mdUtils,
4868
ModuleMetaData& MD,

IGC/Compiler/MetaDataApi/IGCMetaDataHelper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace IGC::IGCMD {
1919
public:
2020
static void addFunction(MetaDataUtils& mdUtils, llvm::Function* pFunc, IGC::FunctionTypeMD type = IGC::FunctionTypeMD::KernelFunction);
2121
static void moveFunction(MetaDataUtils& mdUtils, ModuleMetaData& MD, llvm::Function* OldFunc, llvm::Function* NewFunc);
22+
static void copyFunction(MetaDataUtils& mdUtils, ModuleMetaData& MD, llvm::Function* OldFunc, llvm::Function* NewFunc);
2223
static void removeFunction(MetaDataUtils& mdUtils, ModuleMetaData& MD, llvm::Function* Func);
2324

2425
// In OCL, thread group size (hint) is given by kernel attributes reqd_work_group_size and work_group_size_hint.

0 commit comments

Comments
 (0)