Skip to content

Commit 7870b86

Browse files
aus-intelsys_zuul
authored andcommitted
Release visa builders in genx module
Change-Id: I8866eca6d714673d2d10108011342d7a1e3a90d5
1 parent 70df500 commit 7870b86

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5655,8 +5655,6 @@ class GenXFinalizer : public ModulePass {
56555655
if (GenerateDebugInfo)
56565656
emitDebugInformation(*CisaBuilder, GM, FGA, ST);
56575657

5658-
GM.DestroyCISABuilder();
5659-
GM.DestroyVISAAsmReader();
56605658
Out << ss.str();
56615659
return false;
56625660
}

IGC/VectorCompiler/lib/GenXCodeGen/GenXModule.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,24 @@ namespace llvm {
101101

102102
std::map<const Function *, genx::VisaDebugInfo> VisaDebugMap;
103103

104-
public:
105-
static char ID;
106-
explicit GenXModule() : ModulePass(ID) {}
107-
~GenXModule() {
104+
private:
105+
void cleanup() {
108106
DestroyCISABuilder();
109107
DestroyVISAAsmReader();
108+
ArgStorage.Reset();
110109
}
111-
virtual StringRef getPassName() const { return "GenX module"; }
112-
void getAnalysisUsage(AnalysisUsage &AU) const;
113-
bool runOnModule(Module &M);
110+
111+
public:
112+
static char ID;
113+
114+
explicit GenXModule() : ModulePass(ID) {}
115+
~GenXModule() { cleanup(); }
116+
117+
StringRef getPassName() const override { return "GenX module"; }
118+
void getAnalysisUsage(AnalysisUsage &AU) const override;
119+
bool runOnModule(Module &M) override;
120+
void releaseMemory() override { cleanup(); }
121+
114122
const GenXSubtarget *getSubtarget() { return ST; }
115123
bool HasInlineAsm() const { return InlineAsm; }
116124
VISABuilder *GetCisaBuilder();

0 commit comments

Comments
 (0)