Skip to content

Commit cc4c6f8

Browse files
scottp101igcbot
authored andcommitted
code cleanup
code cleanup
1 parent 0d80e92 commit cc4c6f8

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

IGC/Compiler/CodeGenContext.cpp

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,6 @@ namespace IGC
845845
/// there is no user-forced setting
846846
uint32_t CodeGenContext::getNumGRFPerThread(bool returnDefault)
847847
{
848-
constexpr uint32_t DEFAULT_TOTAL_GRF_NUM = 128;
849-
850848
if (m_NumGRFPerThread)
851849
return m_NumGRFPerThread;
852850

@@ -857,29 +855,18 @@ namespace IGC
857855
}
858856
if (getModuleMetaData()->csInfo.forceTotalGRFNum != 0)
859857
{
860-
if ((this->type == ShaderType::RAYTRACING_SHADER ||
861-
this->type == ShaderType::BINDLESS_SHADER) &&
862-
platform.isCoreChildOf(IGFX_XE2_LPG_CORE) &&
863-
getModuleMetaData()->csInfo.forceTotalGRFNum > DEFAULT_TOTAL_GRF_NUM)
864-
{
865-
m_NumGRFPerThread = DEFAULT_TOTAL_GRF_NUM;
866-
return m_NumGRFPerThread;
867-
}
868-
else
869-
{
870-
m_NumGRFPerThread = getModuleMetaData()->csInfo.forceTotalGRFNum;
871-
return m_NumGRFPerThread;
872-
}
858+
m_NumGRFPerThread = getModuleMetaData()->csInfo.forceTotalGRFNum;
859+
return m_NumGRFPerThread;
873860
}
874861

875-
876862
// read value from CompOptions first
877-
DWORD GRFNum4RQToUse = getModuleMetaData()->compOpt.ForceLargeGRFNum4RQ ? 0x100 : 0;
863+
DWORD GRFNum4RQToUse = getModuleMetaData()->compOpt.ForceLargeGRFNum4RQ ? 256 : 0;
878864

879865
// override if reg key value is set
880-
GRFNum4RQToUse = IGC_IS_FLAG_ENABLED( TotalGRFNum4RQ ) ? IGC_GET_FLAG_VALUE( TotalGRFNum4RQ ) : GRFNum4RQToUse;
866+
GRFNum4RQToUse = IGC_IS_FLAG_ENABLED( TotalGRFNum4RQ ) ?
867+
IGC_GET_FLAG_VALUE( TotalGRFNum4RQ ) : GRFNum4RQToUse;
881868

882-
if (hasSyncRTCalls() && (this->type != ShaderType::RAYTRACING_SHADER) && GRFNum4RQToUse != 0)
869+
if (hasSyncRTCalls() && GRFNum4RQToUse != 0)
883870
{
884871
m_NumGRFPerThread = GRFNum4RQToUse;
885872
return m_NumGRFPerThread;

IGC/Compiler/CodeGenPublic.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,8 @@ namespace IGC
897897

898898
PushConstantMode m_pushConstantMode = PushConstantMode::DEFAULT;
899899

900+
static constexpr uint32_t DEFAULT_TOTAL_GRF_NUM = 128;
901+
900902
SInstrTypes m_instrTypes = {};
901903
SInstrTypes m_instrTypesAfterOpts = {};
902904
// The module contains global variables with private address space.
@@ -988,7 +990,6 @@ namespace IGC
988990
uint64_t m_SIMDInfo = 0;
989991
uint32_t HdcEnableIndexSize = 0;
990992
std::vector<RoutingIndex> HdcEnableIndexValues;
991-
uint32_t m_NumGRFPerThread = 0;
992993

993994
// Flag per function/kernel informing about if it has
994995
// expensive loops and needs trigger retry compilation
@@ -1020,6 +1021,7 @@ namespace IGC
10201021
/// input: IGC MetaData Utils
10211022
IGC::IGCMD::MetaDataUtils* m_pMdUtils = nullptr;
10221023
IGC::ModuleMetaData* modMD = nullptr;
1024+
uint32_t m_NumGRFPerThread = 0;
10231025

10241026
virtual void setFlagsPerCtx();
10251027

0 commit comments

Comments
 (0)