Skip to content

Commit

Permalink
Remove unused HasFuncExpensiveLoop function
Browse files Browse the repository at this point in the history
Function was added as part of RegPressureLoopControl pass, which got
superseded by CodeLoopSinking and removed.
  • Loading branch information
stefan-il authored and igcbot committed Nov 15, 2024
1 parent 8acaf52 commit 4d8019b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
11 changes: 4 additions & 7 deletions IGC/Compiler/CISACodeGen/CISABuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7048,9 +7048,8 @@ namespace IGC
{
auto funcInfoMD = context->getMetaDataUtils()->getFunctionsInfoItem(m_program->entry);
int subGrpSize = funcInfoMD->getSubGroupSize()->getSIMDSize();
bool noRetry = ((subGrpSize > 0 || jitInfo->stats.spillMemUsed < 1000) &&
context->m_instrTypes.mayHaveIndirectOperands) &&
!context->HasFuncExpensiveLoop(m_program->entry);
bool noRetry = (subGrpSize > 0 || jitInfo->stats.spillMemUsed < 1000) &&
context->m_instrTypes.mayHaveIndirectOperands;

if (context->type == ShaderType::OPENCL_SHADER)
{
Expand Down Expand Up @@ -7079,12 +7078,11 @@ namespace IGC
std::stringstream ss;
ss << endl << "Stack Function Spill Info:" << endl;
ss << "KERNEL: " << m_program->entry->getName().str() << endl;
if (m_program->m_spillCost > threshold || context->HasFuncExpensiveLoop(m_program->entry))
if (m_program->m_spillCost > threshold)
{
// First check the kernel
noRetryForStack = false;
context->m_retryManager.PerFuncRetrySet.insert(m_program->entry->getName().str());
ss << " HasFuncExpensiveLoop = " << context->HasFuncExpensiveLoop(m_program->entry) << std::endl;
ss << " numGRFSpill = " << jitInfo->stats.numGRFSpillFillWeighted << std::endl;
ss << " TotalInsts = " << jitInfo->stats.numAsmCountUnweighted << std::endl;
}
Expand All @@ -7093,14 +7091,13 @@ namespace IGC
vISA::FINALIZER_INFO* f_jitInfo = nullptr;
func.second->GetJitInfo(f_jitInfo);
//float spillCost = float(f_jitInfo->stats.numGRFSpillFillWeighted) / f_jitInfo->stats.numAsmCountUnweighted;
if (f_jitInfo->stats.numGRFSpillFillWeighted > 0 || context->HasFuncExpensiveLoop(func.first))
if (f_jitInfo->stats.numGRFSpillFillWeighted > 0)
{
// Check each stackcall function
noRetryForStack = false;
string FName = StripCloneName(func.first->getName().str());
context->m_retryManager.PerFuncRetrySet.insert(FName);
ss << " STACK_FUNC Retry: " << FName << std::endl;
ss << " HasFuncExpensiveLoop = " << context->HasFuncExpensiveLoop(func.first) << std::endl;
ss << " numGRFSpill = " << f_jitInfo->stats.numGRFSpillFillWeighted << std::endl;
ss << " TotalInsts = " << f_jitInfo->stats.numAsmCountUnweighted << std::endl;
}
Expand Down
11 changes: 0 additions & 11 deletions IGC/Compiler/CodeGenContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,17 +749,6 @@ namespace IGC
return true;
}

bool CodeGenContext::HasFuncExpensiveLoop(llvm::Function* pFunc)
{
if (m_FuncHasExpensiveLoops.find(pFunc) !=
m_FuncHasExpensiveLoops.end())
{
return m_FuncHasExpensiveLoops[pFunc];
}
return false;
}


static std::string demangleFuncName(const std::string &rawName) {
// OpenMP adds additional prefix and suffix to the mangling scheme,
// remove it if present.
Expand Down
6 changes: 0 additions & 6 deletions IGC/Compiler/CodeGenPublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1009,12 +1009,6 @@ namespace IGC
uint32_t HdcEnableIndexSize = 0;
std::vector<RoutingIndex> HdcEnableIndexValues;

// Flag per function/kernel informing about if it has
// expensive loops and needs trigger retry compilation
std::unordered_map<llvm::Function*, bool> m_FuncHasExpensiveLoops;

bool HasFuncExpensiveLoop(llvm::Function* pFunc);

// Raytracing (any shader type)
BVHInfo bvhInfo;
// Immediate constant buffer promotion is enabled for all optimization except for Direct storage case
Expand Down

0 comments on commit 4d8019b

Please sign in to comment.