Skip to content

Commit e932ed8

Browse files
davidjwoosys_zuul
authored and
sys_zuul
committed
Use vISA_setFFID to overwrite FFID when necessary
Change-Id: I280ad152b64ce4256c53a1fd50f7f3f05d4332c4
1 parent 800b9c6 commit e932ed8

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3725,6 +3725,21 @@ namespace IGC
37253725
SaveOption(vISA_DumpCompilerStats, true);
37263726
}
37273727

3728+
if (IGC_IS_FLAG_ENABLED(ForceFFIDOverwrite) && m_program->m_Platform->WaOverwriteFFID())
3729+
{
3730+
static const unsigned int ffid[unsigned(ShaderType::END)] = {
3731+
0,
3732+
FFID_VS,
3733+
FFID_HS,
3734+
FFID_DS,
3735+
FFID_GS,
3736+
FFID_PS,
3737+
FFID_GP,
3738+
FFID_GP
3739+
};
3740+
SaveOption(vISA_setFFID, ffid[unsigned(context->type)]);
3741+
}
3742+
37283743
if (context->type == ShaderType::OPENCL_SHADER && context->m_floatDenormMode32 == FLOAT_DENORM_RETAIN &&
37293744
context->m_floatDenormMode64 == FLOAT_DENORM_RETAIN)
37303745
{
@@ -4906,6 +4921,8 @@ namespace IGC
49064921
pOutput->m_scratchSpaceUsedByGtpin = jitInfo->numBytesScratchGtpin;
49074922

49084923
pOutput->m_offsetToSkipPerThreadDataLoad = jitInfo->offsetToSkipPerThreadDataLoad;
4924+
4925+
pOutput->m_offsetToSkipSetFFIDGP = jitInfo->offsetToSkipSetFFIDGP;
49094926
}
49104927

49114928
void CEncoder::DestroyVISABuilder()

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,11 @@ namespace IGC
450450
return m_WaTable.Wa_1805992985 != 0;
451451
}
452452

453+
bool WaOverwriteFFID() const
454+
{
455+
return m_WaTable.Wa_1409460247 != 0;
456+
}
457+
453458
bool alignBindlessSampler() const
454459
{
455460
return IGC_IS_FLAG_ENABLED(Use16ByteBindlessSampler) &&

IGC/Compiler/CodeGenPublic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ namespace IGC
110110
unsigned int m_funcRelocationTableSize;
111111
unsigned int m_funcRelocationTableEntries;
112112
unsigned int m_offsetToSkipPerThreadDataLoad = 0;
113+
uint32_t m_offsetToSkipSetFFIDGP = 0;
113114
//true means we separate pvtmem and spillfill. pvtmem could go into stateless.
114115
//false means all of them are together
115116
bool m_separatePvtSpill = false;

IGC/common/igc_flags.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ DECLARE_IGC_REGKEY(bool, EnableAdvMemOpt, true, "Enable advanced
277277
DECLARE_IGC_REGKEY(bool, UniformMemOptLimit, 0, "Limit of uniform memory optimization in bits", false)
278278
DECLARE_IGC_REGKEY(bool, EnableFunctionPointer, true, "Enables support for function pointers and indirect calls", false)
279279
DECLARE_IGC_REGKEY(bool, EnableIndirectCallOptimization, false, "Enables inlining indirect calls by comparing function addresses", false)
280+
DECLARE_IGC_REGKEY(bool, ForceFFIDOverwrite, false, "Force overwriting ffid in sr0.0", false)
280281

281282
DECLARE_IGC_REGKEY(bool, EnableReadGTPinInput, true, "Enables setting GTPin context flags by reading the input to the compiler adapters", false)
282283

0 commit comments

Comments
 (0)