xo-jit: print IR before- and after- optimization

This commit is contained in:
Roland Conybeare 2024-06-21 17:01:11 -04:00
commit 6abede9c33

View file

@ -519,9 +519,25 @@ namespace xo {
/* validate! always validate! */
llvm::verifyFunction(*fn);
if (log) {
std::string buf;
llvm::raw_string_ostream ss(buf);
fn->print(ss);
log(xtag("IR-before-opt", buf));
}
/* optimize! improves IR */
ir_pipeline_->run_pipeline(*fn); // llvm_fpmgr_->run(*fn, *llvm_famgr_);
if (log) {
std::string buf;
llvm::raw_string_ostream ss(buf);
fn->print(ss);
log(xtag("IR-after-opt", buf));
}
return fn;
}