[llvm-dev] Easy way to add common pass for optimization

Yafei Liu via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 15 01:53:45 PDT 2019


Hi all,
I wrote a compiler front end which generates IR codes, but due to the
logic, the IR codes have a lot of  instructions like unnecessary br jump,
basic block creation, load instructions and expression which can be
simplified.
now I want to use built in passes to optimize the generated code, but after
I read the tutorial: https://llvm.org/docs/tutorial/MyFirstLanguageFrontend,
I found that I have to add passess one by one, on function level.

I know these passes for module level, but I don't know what passes I should
add, and I do not have special optimization requirements, so built-in
passes will meet my requirements, So this there any easy way to add most
common passes which all compilers will probable used?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191015/6d8e990e/attachment.html>


More information about the llvm-dev mailing list