<div dir="ltr">Hi all, <div>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.</div><div>now I want to use built in passes to optimize the generated code, but after I read the tutorial: <a href="https://llvm.org/docs/tutorial/MyFirstLanguageFrontend">https://llvm.org/docs/tutorial/MyFirstLanguageFrontend</a>, I found that I have to add passess one by one, on function level.</div><div><br></div><div>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?</div></div>