@@ -254,34 +254,29 @@ bool EmitPass::canCompileCurrentShader(llvm::Function& F)
254254 // If uses subroutines/stackcall, we can only compile a single SIMD mode
255255 if (m_FGA && (!m_FGA->getGroup(&F)->isSingle() || m_FGA->getGroup(&F)->hasStackCall()))
256256 {
257- SIMDMode compiledSIMD = SIMDMode::UNKNOWN;
258-
257+ // Check if a specific SIMD size is enforced
259258 if (ctx->type == ShaderType::OPENCL_SHADER)
260259 {
261- // If SIMD sized is forced by IGC flag, compile the forced mode
262260 if (m_moduleMD->csInfo.forcedSIMDSize != 0)
263261 {
264- compiledSIMD = lanesToSIMDMode((unsigned)m_moduleMD->csInfo.forcedSIMDSize);
262+ return m_SimdMode = = lanesToSIMDMode((unsigned)m_moduleMD->csInfo.forcedSIMDSize);
265263 }
266- // If max work group size is set, we need to compile the least allowed SIMD
267- else if (ctx->m_DriverInfo.sendMultipleSIMDModes() && m_moduleMD->csInfo.maxWorkGroupSize != 0)
264+
265+ if (ctx->m_DriverInfo.sendMultipleSIMDModes() && m_moduleMD->csInfo.maxWorkGroupSize != 0)
268266 {
269- compiledSIMD = getLeastSIMDAllowed(m_moduleMD->csInfo.maxWorkGroupSize, GetHwThreadsPerWG(ctx->platform));
267+ return m_SimdMode = = getLeastSIMDAllowed(m_moduleMD->csInfo.maxWorkGroupSize, GetHwThreadsPerWG(ctx->platform));
270268 }
271269 }
272- if (compiledSIMD != SIMDMode::UNKNOWN)
273- {
274- return (m_SimdMode == compiledSIMD);
275- }
276- else if (ctx->m_enableFunctionPointer)
270+
271+ if (ctx->m_enableFunctionPointer)
277272 {
278- // Can compile SIMD8 and SIMD16 for function pointers
273+ // Can compile both SIMD8 and SIMD16 for function pointers
279274 return (m_SimdMode == SIMDMode::SIMD8 || m_SimdMode == SIMDMode::SIMD16);
280275 }
281276 else
282277 {
283- // Default SIMD8
284- return m_SimdMode == SIMDMode::SIMD8 ;
278+ // Can't support SIMD32 due to slicing
279+ return m_SimdMode != SIMDMode::SIMD32 ;
285280 }
286281 }
287282 else if(m_moduleMD->compOpt.IsLibraryCompilation == true)
0 commit comments