I wrote 2 passes and I want to make run llvm run the passes in this order:
-mem2reg -load=…/mypass1.dylib -mypass1 -load=…/mypass2.dylib -mypass2 -O1 -O2 -O3
I know I can do this by manually passing them as an argument to opt.
Is there any way to force this sequence directly from clang?
I am asking this because I am trying to compile a program and I can specify in the ./configure the CC and CFLAGS options. So if there is an option to force the sequence directly from clang it would be the easiest thing to do.
If there is not, is there a way to specify this order by modifying the llvm code?
I am new to the PassManager and PassRegistry and I am not sure if I should use them, therefore every detailed procedure will be appreciated.
Thank you in advance,