In general, if I put two LLVM passes into a single command-line call, like this...
$(LLVM_HOME)opt -my-pass -another-pass < foo1.bc > foo2.bc
...is this defined to be exactly the same as running the two passes consecutively, with an additional intermediate file, like this...
$(LLVM_HOME)opt -my-pass < foo1.bc > foo11.bc
$(LLVM_HOME)opt -another-pass < foo11.bc > foo2.bc
...or are those two passes performed simultaneously in some way?
If the two passes are transformation passes, like -simplifycfg and -licm, then yes, you can think of there being an intermediary file between the two and run the commands as you suggest.
However, there also exist analysis passes, like -aa for alias analysis. These ones will not work as you describe, because they don't massage the IR, they just provide information to passes that do (like -licm for example).
So, opt -aa -licm is not equivalent to opt -aa followed by opt -licm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With