xo-jit: print IR before- and after- optimization
This commit is contained in:
parent
f1de52b962
commit
6abede9c33
1 changed files with 16 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue