Skip to content

Commit d19cdc5

Browse files
michalkr52igcbot
authored andcommitted
Refactor ZEBinary flags and documentation
Refactored all conditions based on enableZEBinary() and supportsZEBin(), as if they were always true. Removed said conditions.
1 parent aafca7e commit d19cdc5

File tree

11 files changed

+8
-36
lines changed

11 files changed

+8
-36
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5634,8 +5634,7 @@ void CEncoder::Compile(bool hasSymbolTable, GenXFunctionGroupAnalysis *&pFGA) {
56345634

56355635
createSymbolAndGlobalHostAccessTables(hasSymbolTable, *pMainKernel, pOutput->m_scratchSpaceUsedBySpills);
56365636
createRelocationTables(*pMainKernel);
5637-
if (context->enableZEBinary())
5638-
CreateFuncAttributeTable(pMainKernel, pFGA);
5637+
CreateFuncAttributeTable(pMainKernel, pFGA);
56395638

56405639
pOutput->m_numGRFSpillFill = jitInfo->stats.numGRFSpillFillWeighted;
56415640

@@ -5652,7 +5651,7 @@ void CEncoder::Compile(bool hasSymbolTable, GenXFunctionGroupAnalysis *&pFGA) {
56525651

56535652
pOutput->m_perThreadArgumentStackSize = m_argumentStackSize;
56545653

5655-
if (context->enableZEBinary() && context->type == ShaderType::OPENCL_SHADER &&
5654+
if (context->type == ShaderType::OPENCL_SHADER &&
56565655
IGC_IS_FLAG_ENABLED(EnableKernelCostInfo)) {
56575656
kci = createKernelCostInfo(*pMainKernel);
56585657
}
@@ -5710,8 +5709,6 @@ void CEncoder::createRelocationTables(VISAKernel &pMainKernel) {
57105709
}
57115710

57125711
const vISA::KernelCostInfo *CEncoder::createKernelCostInfo(VISAKernel &pMainKernel) {
5713-
CodeGenContext *context = m_program->GetContext();
5714-
IGC_ASSERT(context->enableZEBinary());
57155712
const vISA::KernelCostInfo *KCI = nullptr;
57165713
pMainKernel.getKernelCostInfo(KCI);
57175714
if (!KCI) {

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ bool EmitPass::runOnFunction(llvm::Function &F) {
889889
auto vMod = IGC::ScalarVisaModule::BuildNew(m_currShader, Entry, IsPrimary);
890890
IGC::DebugEmitterOpts DebugOpts;
891891
DebugOpts.DebugEnabled = DebugInfoData::hasDebugInfo(m_currShader);
892-
DebugOpts.ZeBinCompatible = IGC_IS_FLAG_ENABLED(ZeBinCompatibleDebugging) && m_pCtx->enableZEBinary();
892+
DebugOpts.ZeBinCompatible = IGC_IS_FLAG_ENABLED(ZeBinCompatibleDebugging);
893893
DebugOpts.EnableRelocation = IGC_IS_FLAG_ENABLED(EnableRelocations) || DebugOpts.ZeBinCompatible;
894894
DebugOpts.EnforceAMD64Machine = IGC_IS_FLAG_ENABLED(DebugInfoEnforceAmd64EM) || DebugOpts.ZeBinCompatible;
895895
DebugOpts.EnableDebugInfoValidation = IGC_IS_FLAG_ENABLED(DebugInfoValidation);

IGC/Compiler/CISACodeGen/GenCodeGenModule.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,12 @@ bool GenXCodeGenModule::runOnModule(Module &M) {
459459
// compiled once and runtime must relocate its address for each caller.
460460
m_FunctionCloningThreshold = 0;
461461
if (IGC_IS_FLAG_ENABLED(EnableFunctionCloningControl)) {
462-
if (getAnalysis<CodeGenContextWrapper>().getCodeGenContext()->enableZEBinary()) {
463-
// Avoid cloning by default on zebin
464-
m_FunctionCloningThreshold = 1;
465-
}
466462
if (IGC_GET_FLAG_VALUE(FunctionCloningThreshold) != 0) {
467463
// Overwrite with debug flag
468464
m_FunctionCloningThreshold = IGC_GET_FLAG_VALUE(FunctionCloningThreshold);
465+
} else {
466+
// Avoid cloning by default on zebin
467+
m_FunctionCloningThreshold = 1;
469468
}
470469
}
471470

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class OpenCLProgramContext : public CodeGenContext {
6565

6666
}
6767

68-
bool enableZEBinary() const override { return true; }
6968
bool isSPIRV() const;
7069
void setAsSPIRV();
7170
float getProfilingTimerResolution();

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -556,19 +556,6 @@ class CPlatform {
556556
return m_platformInfo.eRenderCoreFamily == IGFX_XE_HPC_CORE && IGC_IS_FLAG_ENABLED(EnableQWRotateInstructions);
557557
}
558558

559-
bool supportsZEBin() const {
560-
switch (m_platformInfo.eProductFamily) {
561-
default:
562-
return true;
563-
case IGFX_BROADWELL:
564-
case IGFX_BROXTON:
565-
case IGFX_GEMINILAKE:
566-
case IGFX_LAKEFIELD:
567-
case IGFX_ELKHARTLAKE:
568-
return false;
569-
}
570-
}
571-
572559
bool isIntegratedGraphics() const {
573560
switch (m_platformInfo.eProductFamily) {
574561
case IGFX_DG1:

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,9 +3026,6 @@ bool AllowShortImplicitPayloadHeader(const CodeGenContext *ctx) {
30263026
if (value != TriboolFlag::Default)
30273027
return value == TriboolFlag::Enabled;
30283028

3029-
if (!ctx->platform.supportsZEBin())
3030-
return false;
3031-
30323029
if (ctx->type == ShaderType::OPENCL_SHADER) {
30333030
auto *OCLCtx = static_cast<const OpenCLProgramContext *>(ctx);
30343031
if (OCLCtx->m_InternalOptions.PromoteStatelessToBindless && OCLCtx->m_InternalOptions.UseBindlessLegacyMode)
@@ -3047,9 +3044,6 @@ bool AllowRemovingUnusedImplicitArguments(const CodeGenContext *ctx) {
30473044
if (value != TriboolFlag::Default)
30483045
return value == TriboolFlag::Enabled;
30493046

3050-
if (!ctx->platform.supportsZEBin())
3051-
return false;
3052-
30533047
if (ctx->type == ShaderType::OPENCL_SHADER) {
30543048
auto *OCLCtx = static_cast<const OpenCLProgramContext *>(ctx);
30553049
if (OCLCtx->m_InternalOptions.PromoteStatelessToBindless && OCLCtx->m_InternalOptions.UseBindlessLegacyMode)

IGC/Compiler/CodeGenContext.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,6 @@ int32_t CodeGenContext::getNumThreadsPerEU() const { return -1; }
699699

700700
uint32_t CodeGenContext::getExpGRFSize() const { return 0; }
701701

702-
bool CodeGenContext::enableZEBinary() const { return false; }
703-
704702
/// parameter "returnDefault" controls what to return when
705703
/// there is no user-forced setting
706704
uint32_t CodeGenContext::getNumGRFPerThread(bool returnDefault) {

IGC/Compiler/CodeGenPublic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,6 @@ class CodeGenContext {
10331033
virtual int16_t getVectorCoalescingControl() const;
10341034
virtual uint32_t getPrivateMemoryMinimalSizePerThread() const;
10351035
virtual uint32_t getIntelScratchSpacePrivateMemoryMinimalSizePerThread() const;
1036-
virtual bool enableZEBinary() const;
10371036
bool isPOSH() const;
10381037
virtual bool isBufferBoundsChecking() const;
10391038
virtual uint64_t getMinimumValidAddress() const;

IGC/VISALinkerDriver/VLD.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ using namespace TC;
292292
//
293293
// Assumptions:
294294
// 1. ZEBinary output format is used in SPMD+ESIMD case.
295-
// TODO: error out if patch token output format is used.
296295
bool TranslateBuildSPMDAndESIMD(const TC::STB_TranslateInputArgs *pInputArgs, TC::STB_TranslateOutputArgs *pOutputArgs,
297296
TC::TB_DATA_FORMAT inputDataFormatTemp, const IGC::CPlatform &IGCPlatform,
298297
float profilingTimerResolution, const ShaderHash &inputShHash,

IGC/common/igc_flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ DECLARE_IGC_REGKEY(
540540
"Enable Stateless To Stateful transformation for global and constant address space in OpenCL kernels", false)
541541
DECLARE_IGC_REGKEY(
542542
bool, EnableStatefulToken, true,
543-
"Enable generating patch token to indicate a ptr argument is fully converted to stateful (temporary)", false)
543+
"Enable to indicate ptr arguments are fully converted to stateful (temporary)", false)
544544
DECLARE_IGC_REGKEY(bool, DisableConstBaseGlobalBaseArg, false,
545545
"Do no generate kernel implicit arguments: constBase and globalBase", false)
546546
DECLARE_IGC_REGKEY(bool, EnableGenUpdateCB, false, "Enable derived constant optimization.", false)

0 commit comments

Comments
 (0)