@@ -8,7 +8,6 @@ SPDX-License-Identifier: MIT
88
99#include " Compiler/CISACodeGen/CISABuilder.hpp"
1010#include " Compiler/CISACodeGen/ShaderCodeGen.hpp"
11- #include " Compiler/CISACodeGen/IGCLivenessAnalysis.h"
1211#include " Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp"
1312#include " Compiler/Optimizer/OpenCLPasses/NamedBarriers/NamedBarriersResolution.hpp"
1413#include " common/allocator.h"
@@ -3548,8 +3547,8 @@ void CEncoder::SetAbortOnSpillThreshold(bool canAbortOnSpill, bool AllowSpill) {
35483547 }
35493548}
35503549
3551- void CEncoder::InitVISABuilderOptions (TARGET_PLATFORM VISAPlatform, SIMDMode simdMode , bool canAbortOnSpill ,
3552- bool hasStackCall, bool enableVISA_IR) {
3550+ void CEncoder::InitVISABuilderOptions (TARGET_PLATFORM VISAPlatform, bool canAbortOnSpill , bool hasStackCall ,
3551+ bool enableVISA_IR) {
35533552 CodeGenContext *context = m_program->GetContext ();
35543553 bool KernelDebugEnable = false ;
35553554 bool ForceNonCoherentStatelessBti = false ;
@@ -4242,16 +4241,13 @@ void CEncoder::InitVISABuilderOptions(TARGET_PLATFORM VISAPlatform, SIMDMode sim
42424241
42434242 auto funcInfoMD = context->getMetaDataUtils ()->getFunctionsInfoItem (m_program->entry );
42444243 uint32_t MaxRegPressure = funcInfoMD->getMaxRegPressure ()->getMaxPressure ();
4245- // need to adjust since MaxRegPressure assumes minimal SIMD
4246- auto guessedSimd = IGCLivenessAnalysisBase::bestGuessSIMDSize (context, context->getMetaDataUtils (), m_program->entry );
4247- MaxRegPressure = MaxRegPressure * numLanes (simdMode) / numLanes (guessedSimd);
42484244 uint32_t RegPressureThreshold = (uint32_t )(context->getNumGRFPerThread (true ) * 0.6 );
4249- bool maxPressureHeur = MaxRegPressure > 0 && MaxRegPressure < RegPressureThreshold &&
4250- m_program->GetParent ()->getLLVMFunction ()->size () == 1 ;
4245+
42514246 if (context->type == ShaderType::OPENCL_SHADER &&
4252- (m_program->m_Platform ->limitedBCR () || (maxPressureHeur ))) {
4247+ (m_program->m_Platform ->limitedBCR () || (MaxRegPressure > 0 && MaxRegPressure < RegPressureThreshold ))) {
42534248 SaveOption (vISA_enableBCR, true );
4254- if (m_program->m_Platform ->getMinDispatchMode () != SIMDMode::SIMD8)
4249+ if (m_program->GetParent ()->getLLVMFunction ()->size () == 1 &&
4250+ m_program->m_Platform ->getMinDispatchMode () != SIMDMode::SIMD8)
42554251 SaveOption (vISA_forceBCR, true );
42564252 }
42574253 if (context->type == ShaderType::OPENCL_SHADER && m_program->m_Platform ->supportDpasInstruction ()) {
@@ -4740,7 +4736,7 @@ void CEncoder::InitLabelMap(const llvm::Function *F) {
47404736 }
47414737}
47424738
4743- void CEncoder::InitEncoder (SIMDMode simdMode, bool canAbortOnSpill, bool hasStackCall, bool hasInlineAsmCall,
4739+ void CEncoder::InitEncoder (bool canAbortOnSpill, bool hasStackCall, bool hasInlineAsmCall,
47444740 bool hasAdditionalVisaAsmToLink, int numThreadsPerEU, uint lowerBoundGRF, uint upperBoundGRF,
47454741 VISAKernel *prevKernel) {
47464742 m_aliasesMap.clear ();
@@ -4788,7 +4784,7 @@ void CEncoder::InitEncoder(SIMDMode simdMode, bool canAbortOnSpill, bool hasStac
47884784 if (IsCodePatchCandidate ()) {
47894785 SetHasPrevKernel (prevKernel != nullptr );
47904786 }
4791- InitVISABuilderOptions (VISAPlatform, simdMode, canAbortOnSpill, hasStackCall, builderOpt == VISA_BUILDER_BOTH);
4787+ InitVISABuilderOptions (VISAPlatform, canAbortOnSpill, hasStackCall, builderOpt == VISA_BUILDER_BOTH);
47924788
47934789 if (numThreadsPerEU > 0 ) {
47944790 // Number of threads per EU is set per kernel (by function MD)
0 commit comments