Skip to content

Commit 797ae16

Browse files
dlei6gsys_zuul
authored and
sys_zuul
committed
Compile subroutines in higher SIMD based on threadgroup size
Change-Id: Ie99b910025f9668ed6dcfa0897004be38f97dbee
1 parent 1251723 commit 797ae16

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,6 @@ bool EmitPass::setCurrentShader(llvm::Function* F)
227227
{
228228
return false;
229229
}
230-
// Only simd8 will be tried when there are subroutines in this group.
231-
if (m_SimdMode != SIMDMode::SIMD8 && !FG->isSingle())
232-
{
233-
return false;
234-
}
235230
Kernel = FG->getHead();
236231
}
237232
else
@@ -350,6 +345,15 @@ bool EmitPass::runOnFunction(llvm::Function& F)
350345
return false;
351346
}
352347

348+
// If max work group size is set, we need to compile for all requested SIMD modes.
349+
// Otherwise, only compile simd8 for subroutines
350+
if (ctx->getModuleMetaData()->csInfo.maxWorkGroupSize == 0 &&
351+
m_FGA && !m_FGA->getGroup(&F)->isSingle() &&
352+
m_SimdMode != SIMDMode::SIMD8)
353+
{
354+
return false;
355+
}
356+
353357
bool isCloned = false;
354358
if (DebugInfoData::hasDebugInfo(m_currShader))
355359
{

0 commit comments

Comments
 (0)