Skip to content

Commit 93b67ab

Browse files
pratikasharigcbot
authored andcommitted
Add compile time options
Add compile time options to disable EU fusion WA and disable compaction.
1 parent 58424c2 commit 93b67ab

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4138,6 +4138,9 @@ namespace IGC
41384138
{
41394139
SaveOption(vISA_skipFDE, true);
41404140
}
4141+
if (ClContext->m_Options.DisableCompaction) {
4142+
SaveOption(vISA_Compaction, false);
4143+
}
41414144
}
41424145

41434146
bool EnableBarrierInstCounterBits = false;
@@ -4511,8 +4514,16 @@ namespace IGC
45114514

45124515
if (m_program->m_Platform->hasFusedEU() && IGC_IS_FLAG_ENABLED(EnableCallWA))
45134516
{
4514-
if (m_program->HasNestedCalls() || m_program->HasIndirectCalls() || m_program->IsIntelSymbolTableVoidProgram())
4515-
{
4517+
bool forceNoWA = false;
4518+
if (context->type == ShaderType::OPENCL_SHADER) {
4519+
auto ClContext = static_cast<OpenCLProgramContext *>(context);
4520+
if (ClContext->m_Options.NoFusedCallWA) {
4521+
forceNoWA = true;
4522+
}
4523+
}
4524+
if (!forceNoWA &&
4525+
(m_program->HasNestedCalls() || m_program->HasIndirectCalls() ||
4526+
m_program->IsIntelSymbolTableVoidProgram())) {
45164527
SaveOption(vISA_fusedCallWA, (uint32_t)1);
45174528
}
45184529
}

IGC/Compiler/CISACodeGen/OpenCLOptions.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,14 @@ void Options::parseOptions(const char* opts)
506506
SkipFDE = true;
507507
}
508508

509+
if (apiOptions.hasArg(OPT_no_fusedCallWA_common)) {
510+
NoFusedCallWA = true;
511+
}
512+
513+
if (apiOptions.hasArg(OPT_disable_compaction_common)) {
514+
DisableCompaction = true;
515+
}
516+
509517
if (const llvm::opt::Arg* arg = apiOptions.getLastArg(OPT_required_thread_count_common))
510518
{
511519
if (arg->getNumValues() > 0)

IGC/Compiler/CISACodeGen/OpenCLOptions.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ class Options
154154
bool GTPinIndirRef = false;
155155
// Skip emission of Frame Descriptor Entry in VISA.
156156
bool SkipFDE = false;
157+
bool NoFusedCallWA = false;
158+
bool DisableCompaction = false;
157159
uint32_t GTPinScratchAreaSizeValue = 0;
158160

159161
std::vector<std::string> LargeGRFKernels;

IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,9 @@ namespace TC
13651365
(strcmp(pParam, "-ze-gtpin-scratch-area-size") == 0) || //used by GTPin
13661366
(strcmp(pParam, "-ze-opt-enable-auto-large-GRF-mode") == 0) ||
13671367
(strcmp(pParam, "-cl-intel-enable-auto-large-GRF-mode") == 0) ||
1368-
(strcmp(pParam, "-ze-skip-fde") == 0);
1368+
(strcmp(pParam, "-ze-skip-fde") == 0) ||
1369+
(strcmp(pParam, "-ze-no-fusedCallWA") == 0) ||
1370+
(strcmp(pParam, "-ze-disable-compaction") == 0);
13691371

13701372
if (isCommonOption)
13711373
{

IGC/Options/include/igc/Options/CommonApiOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ defm gtpin_indir_ref : CommonFlag<"gtpin-indir-ref">;
3030

3131
defm skip_fde : CommonFlag<"skip-fde">;
3232

33+
defm no_fusedCallWA : CommonFlag<"no-fusedCallWA">;
34+
35+
defm disable_compaction : CommonFlag<"disable-compaction">;
36+
3337
def emit_debug : PlainFlag<"g">,
3438
HelpText<"Enable generation of debug information and enables kernel debug">;
3539
// These are coming from NEO when run under debugger.

0 commit comments

Comments
 (0)