Skip to content

Commit fe86232

Browse files
houjenkoigcbot
authored andcommitted
Deallocate when RA spills for code patching to avoid memory leakage
Deallocate when RA spills for code patching to avoid memory leakage
1 parent 9c049be commit fe86232

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,8 @@ bool EmitPass::runOnFunction(llvm::Function& F)
11231123

11241124
if (!m_encoder->IsCodePatchCandidate() ||
11251125
m_encoder->HasPrevKernel() ||
1126-
!m_currShader->ProgramOutput()->m_programBin)
1126+
!m_currShader->ProgramOutput()->m_programBin ||
1127+
m_currShader->ProgramOutput()->m_scratchSpaceUsedBySpills)
11271128
{
11281129
m_pCtx->m_prevShader = nullptr;
11291130
// Postpone destroying VISA builder to

0 commit comments

Comments
 (0)