mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Reduce memory usage by freeing memory occupied by SILModules after IRGen.
There is no need to keep SILModules around after IRGen has generated LLVM IR from them. This reduces the compiler memory usage during LLVM code-generation and optimization phases roughly by 15%-20%.
This commit is contained in:
@@ -860,9 +860,11 @@ private:
|
||||
// IRGen the current line(s).
|
||||
// FIXME: We shouldn't need to use the global context here, but
|
||||
// something is persisting across calls to performIRGeneration.
|
||||
auto LineModule =
|
||||
performIRGeneration(IRGenOpts, REPLInputFile, sil.get(), "REPLLine",
|
||||
getGlobalLLVMContext(), RC.CurIRGenElem);
|
||||
auto LineModule = performIRGeneration(IRGenOpts, REPLInputFile,
|
||||
std::move(sil),
|
||||
"REPLLine",
|
||||
getGlobalLLVMContext(),
|
||||
RC.CurIRGenElem);
|
||||
RC.CurIRGenElem = RC.CurElem;
|
||||
|
||||
if (CI.getASTContext().hadError())
|
||||
|
||||
Reference in New Issue
Block a user