Skip to content

Commit 9b02d43

Browse files
scottp101igcbot
authored andcommitted
refactor code duplication
refactor code duplication
1 parent e304cbe commit 9b02d43

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -4435,8 +4435,7 @@ namespace IGC
44354435
bool enableForRetry = m_program->m_DriverInfo->enableVISAPreRASchedulerForRetry() ||
44364436
context->m_retryManager.AllowVISAPreRAScheduler();
44374437
// PreRA scheduler runs always when VRT is enabled
4438-
enableForRetry |= m_program->m_Platform->supportsVRT() && m_program->m_DriverInfo->supportsVRT() &&
4439-
(context->getModuleMetaData()->compOpt.EnableVRT || IGC_IS_FLAG_ENABLED(EnableVRT));
4438+
enableForRetry |= context->supportsVRT();
44404439

44414440
if (IGC_IS_FLAG_ENABLED(EnableVISAPreSched) &&
44424441
m_program->m_DriverInfo->enableVISAPreRAScheduler() &&
@@ -4923,9 +4922,7 @@ namespace IGC
49234922
else if ((m_program->m_Platform->supportsAutoGRFSelection() &&
49244923
context->m_DriverInfo.supportsAutoGRFSelection() &&
49254924
IGC_IS_FLAG_ENABLED(ForceSupportsAutoGRFSelection)) ||
4926-
(m_program->m_Platform->supportsVRT() &&
4927-
m_program->m_DriverInfo->supportsVRT() &&
4928-
IGC_IS_FLAG_ENABLED(EnableVRT)))
4925+
context->supportsVRT())
49294926
{
49304927
// When user hasn't specified number of threads, we can rely on
49314928
// compiler heuristics

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ namespace IGC
127127
(m_DriverInfo.supportsAutoGRFSelection() ||
128128
m_InternalOptions.IntelEnableAutoLargeGRF ||
129129
m_Options.IntelEnableAutoLargeGRF)
130-
|| platform.supportsVRT() && IGC_IS_FLAG_ENABLED(EnableVRT)
131-
) && !m_InternalOptions.Intel128GRFPerThread &&
130+
|| supportsVRT())
131+
&& !m_InternalOptions.Intel128GRFPerThread &&
132132
!m_Options.Intel128GRFPerThread &&
133133
!m_InternalOptions.Intel256GRFPerThread &&
134134
!m_Options.Intel256GRFPerThread

IGC/Compiler/CodeGenPublic.h

+6
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,12 @@ namespace IGC
13151315
IGC_IS_FLAG_ENABLED(EnableStatelessToStateful) &&
13161316
!m_instrTypes.hasInlineAsmPointerAccess);
13171317
}
1318+
1319+
bool supportsVRT() const
1320+
{
1321+
return platform.supportsVRT() && m_DriverInfo.supportsVRT() &&
1322+
(getModuleMetaData()->compOpt.EnableVRT || IGC_IS_FLAG_ENABLED(EnableVRT));
1323+
}
13181324
};
13191325

13201326
struct SComputeShaderSecondCompileInput

0 commit comments

Comments
 (0)