<div>I'd like to run my own passes (implemented as .so) via the opt tool on a linked bitcode.</div>
<div> </div>
<div>>opt -load=my_own_pass.so -do_my_passes  ... test.bc > test.output.bc</div>
<div> </div>
<div>However, my passes require other LLVM's passes before and after. For example, the ordering of passes that I want:</div>
<div> </div>
<div>(1) A couple of LLVM's passes ==> (2) my_loop_pass ==> (3) my_module_pass ==> (4) Other LLVM's standard O3 optimizations (a bunch of passes).</div>
<div> </div>
<div>Can I enfore such complex pass ordering easily? I'd like to pass just a single argument in opt, which trigers the whole pipeline of passes.</div>
<div> </div>
<div>I tried to use getAnalysisUsage and addRequired. But, the documentation is somewhat vague, I wasn't able even to enforce the pass in (1) to be executed before (2) my loop pass.</div>
<div> </div>
<div>Also, I'm wondering there is a way to run other passes after my pass.</div>
<div> </div>
<div>Actually, I did it by hard coding in clang and LLVM source code. But, I'd like to avoid the changes in clang/LLVM as much as possible so that I don't need to compile LLVM suite.</div>
<div> </div>
<div>Thank you!</div>
<div> </div>