Skip to content

Commit d0c0118

Browse files
itsimbaligcbot
authored andcommitted
_Revert fix for retry
Manually revert the initial fix for xdeps-3640 completely as autobackout script failed.
1 parent 83b6411 commit d0c0118

File tree

4 files changed

+8
-28
lines changed

4 files changed

+8
-28
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6015,7 +6015,6 @@ namespace IGC
60156015
(m_program->HasStackCalls() || m_program->IsIntelSymbolTableVoidProgram()))
60166016
{
60176017
context->m_retryManager.Disable();
6018-
context->m_retryManager.kernelSkip.insert(m_program->entry->getName().str());
60196018
}
60206019

60216020
#if (GET_SHADER_STATS && !PRINT_DETAIL_SHADER_STATS)

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,19 +2382,21 @@ namespace IGC
23822382
pShader->FillKernel(simdMode);
23832383
SProgramOutput* pOutput = pShader->ProgramOutput();
23842384

2385+
// Need a better heuristic for NoRetry
23852386
FunctionInfoMetaDataHandle funcInfoMD = pMdUtils->getFunctionsInfoItem(pFunc);
2387+
int subGrpSize = funcInfoMD->getSubGroupSize()->getSIMD_size();
2388+
bool noRetry = ((subGrpSize > 0 || pOutput->m_scratchSpaceUsedBySpills < 1000) &&
2389+
ctx->m_instrTypes.mayHaveIndirectOperands);
23862390

23872391
bool optDisable = false;
23882392
if (ctx->getModuleMetaData()->compOpt.OptDisable)
23892393
{
23902394
optDisable = true;
23912395
}
23922396

2393-
// Need a better heuristic for NoRetry. Currently spill size is used
2394-
if (pOutput->m_scratchSpaceUsedBySpills < 1000 ||
2397+
if (pOutput->m_scratchSpaceUsedBySpills == 0 ||
2398+
noRetry ||
23952399
ctx->m_retryManager.IsLastTry() ||
2396-
(!ctx->m_retryManager.kernelSkip.empty() &&
2397-
ctx->m_retryManager.kernelSkip.count(pFunc->getName().str())) ||
23982400
optDisable)
23992401
{
24002402
// Save the shader program to the state processor to be handled later
@@ -2473,7 +2475,6 @@ namespace IGC
24732475
}
24742476
}
24752477

2476-
// Clear the retry set and collect kernels for retry in the loop below.
24772478
ctx->m_retryManager.kernelSet.clear();
24782479

24792480
// gather data to send back to the driver
@@ -2507,10 +2508,6 @@ namespace IGC
25072508
GatherDataForDriver(ctx, simd8Shader, pKernel, pFunc, pMdUtils, SIMDMode::SIMD8);
25082509
}
25092510
}
2510-
2511-
// The skip set to avoid retry is not needed. Clear it and collect a new set
2512-
// during retry compilation.
2513-
ctx->m_retryManager.kernelSkip.clear();
25142511
}
25152512

25162513
bool COpenCLKernel::hasReadWriteImage(llvm::Function& F)

IGC/Compiler/CodeGenContext.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace IGC
3939
{ false, true, true, true, false, false, false, false, false, 500 }
4040
};
4141

42-
RetryManager::RetryManager() : enabled(false), perKernel(false)
42+
RetryManager::RetryManager() : enabled(false)
4343
{
4444
memset(m_simdEntries, 0, sizeof(m_simdEntries));
4545
firstStateId = IGC_GET_FLAG_VALUE(RetryManagerFirstStateId);
@@ -107,11 +107,7 @@ namespace IGC
107107
unsigned RetryManager::GetRetryId() const { return stateId; }
108108

109109
void RetryManager::Enable() { enabled = true; }
110-
void RetryManager::Disable() {
111-
if (!perKernel) {
112-
enabled = false;
113-
}
114-
}
110+
void RetryManager::Disable() { enabled = false; }
115111

116112
void RetryManager::SetSpillSize(unsigned int spillSize) { lastSpillSize = spillSize; }
117113
unsigned int RetryManager::GetLastSpillSize() { return lastSpillSize; }

IGC/Compiler/CodeGenPublic.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -976,17 +976,8 @@ namespace IGC
976976
void SetSpillSize(unsigned int spillSize);
977977
unsigned int GetLastSpillSize();
978978
unsigned int numInstructions = 0;
979-
// For OCL the retry manager will work on per-kernel basis, that means
980-
// Disable() will disable only specific kernel. Other kernels still can
981-
// be retried. To keep the old behavior for other shader types, Disable()
982-
// will check the field and keep the old behavior. If other shader
983-
// types want to follow OCL this has to be set, see CodeGenContext
984-
// constructor.
985-
bool perKernel;
986979
/// the set of OCL kernels that need to recompile
987980
std::set<std::string> kernelSet;
988-
/// the set of OCL kernels that need to skip recompilation
989-
std::set<std::string> kernelSkip;
990981

991982
void ClearSpillParams();
992983
// save entry for given SIMD mode, to avoid recompile for next retry.
@@ -1209,9 +1200,6 @@ namespace IGC
12091200

12101201
// Per context flag adjustment
12111202
setFlagsPerCtx();
1212-
1213-
// Set retry behavor for Disable()
1214-
m_retryManager.perKernel = (type == ShaderType::OPENCL_SHADER);
12151203
}
12161204

12171205
CodeGenContext(CodeGenContext&) = delete;

0 commit comments

Comments
 (0)