Question

​Hello all,
I am trying to use optimization passes of llvmlite for my own program. I have deifned the following function for my code as pass function:

def create_pass_manager_builder(opt=3, loop_vectorize=False, slp_vectorize=False):
pmb = llvm.create_pass_manager_builder()
pmb.opt_level = opt
pmb.loop_vectorize = loop_vectorize
pmb.populate = populate
pmb.add_dead_code_elimination_pass = add_dead_code_elimination_pass
pmb.slp_vectorize = slp_vectorize
pmb.inlining_threshold = _inlining_threshold(opt)
return pmb

and I try to run it using the following:

module_ref = llvm1.parse_assembly(str(module))
pmb = llvm.create_pass_manager_builder()
pmb.opt_level = 3
pm = llvm.create_module_pass_manager()
pmb.populate(pm)
pm.run(module_ref)

Having this I do have some optimization for my code. However, when I change the optimization level from 3 to 2 or 0, there is no difference for optimization. Does anyone know why this happens?

Hi Samaneh,

please "use" the subject in your emails and try to be a little bit more exactly what your email is about. Just "question" or "function" as a email subject could be extended by some text. :slight_smile:

Thanks in advance and best regards,
Thomas