Displaying 2 results from an estimated 2 matches for "pass_build".
Did you mean:
pass_builder
2018 Aug 21
2
Function optimization pass
...d = ...load module from LLVM IR bitcode file go_back.bc...
>>
>> auto lift_func = mod->getFunction("go_back");
>> if (not lift_func) {
>> llvm::errs() << "Error: cannot get function\n";
>> return 0;
>> }
>>
>> auto pass_builder = llvm::PassBuilder{};
>> auto fa_manager = llvm::FunctionAnalysisManager{};
>>
>> pass_builder.registerFunctionAnalyses(fa_manager);
>> auto fp_manager =
>> pass_builder.buildFunctionSimplificationPipeline(llvm::PassBuilder::OptimizationLevel::O2);
>>
>>...
2018 Aug 20
2
Function optimization pass
...er || to optimize a
function in a module, what I have done is:
mod = ...load module from LLVM IR bitcode file go_back.bc...
auto lift_func = mod->getFunction("go_back");
if (not lift_func) {
llvm::errs() << "Error: cannot get function\n";
return 0;
}
auto pass_builder = llvm::PassBuilder{};
auto fa_manager = llvm::FunctionAnalysisManager{};
pass_builder.registerFunctionAnalyses(fa_manager);
auto fp_manager =
pass_builder.buildFunctionSimplificationPipeline(llvm::PassBuilder::OptimizationLevel::O2);
fp_manager.run(*lift_func, fa_manager);
...print mod......