Skip to content

Commit d00421d

Browse files
committed
[pattern-gen] Write optimized llvm-ir to irOut
1 parent c904b00 commit d00421d

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

llvm/tools/pattern-gen/Main.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,6 @@ int main(int argc, char **argv) {
128128
auto Mod = std::make_unique<Module>("mod", Ctx);
129129
auto Instrs = ParseCoreDSL2(Ts, (XLen == 64), Mod.get(), NoExtend);
130130

131-
if (irOut) {
132-
std::string Str;
133-
raw_string_ostream OS(Str);
134-
OS << *Mod;
135-
OS.flush();
136-
irOut << Str << "\n";
137-
irOut.close();
138-
}
139-
140131
if (!SkipVerify)
141132
if (verifyModule(*Mod, &errs()))
142133
return -1;
@@ -168,6 +159,10 @@ int main(int argc, char **argv) {
168159
.Is64Bit = (XLen == 64)};
169160

170161
optimizeBehavior(Mod.get(), Instrs, irOut, Args);
162+
163+
if (irOut)
164+
irOut.close();
165+
171166
if (PrintIR)
172167
llvm::outs() << *Mod << "\n";
173168
if (!SkipFmt)

0 commit comments

Comments
 (0)