[llvm-dev] Question

Samaneh Berenjian via llvm-dev llvm-dev at lists.llvm.org
Tue Jul 18 08:41:31 PDT 2017


​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?

-- 
This email was Anti Virus checked by  Security Gateway.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170718/6a531560/attachment.html>


More information about the llvm-dev mailing list