Skip to content

Commit e4b64c1

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: d062d53: CodeGenContext changes wrt LLVMContext
Do not leak LLVMContext in InitLLVMContextWrapper Recreate LLVMContext in resetOnRetry
1 parent d062d53 commit e4b64c1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

IGC/Compiler/CodeGenContext.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ LLVMContextWrapper::LLVMContextWrapper(bool createResourceDimTypes) : m_UserAddr
321321
if (WA_OpaquePointersCL && WA_OpaquePointersCL->getNumOccurrences() > 0) {
322322
IGC_IsPointerModeAlreadySet = true;
323323
}
324-
324+
325325
if (IGC::canOverwriteLLVMCtxPtrMode(basePtr, IGC_IsPointerModeAlreadySet)) {
326326
bool enableOpaquePointers = AreOpaquePointersEnabled();
327327
IGCLLVM::setOpaquePointers(basePtr, enableOpaquePointers);
@@ -389,9 +389,6 @@ void CodeGenContext::print(llvm::raw_ostream &stream) const {
389389
}
390390

391391
void CodeGenContext::initLLVMContextWrapper(bool createResourceDimTypes) {
392-
if (llvmCtxWrapper)
393-
llvmCtxWrapper->Release();
394-
395392
llvmCtxWrapper = new LLVMContextWrapper(createResourceDimTypes);
396393
llvmCtxWrapper->AddRef();
397394
}
@@ -707,11 +704,7 @@ void CodeGenContext::EmitWarning(const char *warningstr, const llvm::Value *cont
707704

708705
CompOptions &CodeGenContext::getCompilerOption() { return getModuleMetaData()->compOpt; }
709706

710-
void CodeGenContext::resetOnRetry() {
711-
m_tempCount = 0;
712-
clear();
713-
initLLVMContextWrapper();
714-
}
707+
void CodeGenContext::resetOnRetry() { m_tempCount = 0; }
715708

716709
int32_t CodeGenContext::getNumThreadsPerEU() const { return -1; }
717710

0 commit comments

Comments
 (0)